mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-11 02:25:39 +03:00
3++ == 4
This commit is contained in:
parent
e7d45eac41
commit
25c52d169d
@ -15,6 +15,7 @@ import qualified Unison.Term as Term
|
||||
import Unison.Type (Type)
|
||||
import qualified Unison.Type as Type
|
||||
import qualified Unison.Var as Var
|
||||
import Unison.Var (Var)
|
||||
|
||||
t :: String -> Type Symbol
|
||||
t s = resolveBuiltinTypes $ unsafeParseType s penv0
|
||||
@ -40,7 +41,7 @@ builtinTerms = Set.map toSymbol (Map.keysSet builtins) where
|
||||
builtinEnv :: [(Symbol, Term Symbol)]
|
||||
builtinEnv = (toSymbol &&& Term.ref) <$> Map.keys builtins
|
||||
|
||||
toSymbol :: (Var.Var v) => R.Reference -> v
|
||||
toSymbol :: Var v => R.Reference -> v
|
||||
toSymbol (R.Builtin txt) = Var.named txt
|
||||
toSymbol _ = error "unpossible"
|
||||
|
||||
|
@ -57,7 +57,7 @@ unsafeReadAndParseFile env filename = do
|
||||
let str = Text.unpack txt
|
||||
pure $ unsafeGetRight (parseFile filename str env)
|
||||
|
||||
file :: Var v => Parser (S v) (UnisonFile v)
|
||||
file :: Parser (S Symbol) (UnisonFile Symbol)
|
||||
file = traced "file" $ do
|
||||
(dataDecls, effectDecls) <- traced "declarations" declarations
|
||||
let (dataDecls', effectDecls', penv') = environmentFor dataDecls effectDecls
|
||||
|
@ -97,6 +97,7 @@ executable bootstrap
|
||||
hs-source-dirs: src
|
||||
other-modules:
|
||||
Unison.ABT
|
||||
Unison.Builtin
|
||||
Unison.Codecs
|
||||
Unison.DataDeclaration
|
||||
Unison.FileParser
|
||||
|
@ -3,9 +3,9 @@ type Optional a = None | Some a
|
||||
|
||||
Optional.isEmpty : ∀ a . Optional a -> Boolean
|
||||
Optional.isEmpty o = case o of
|
||||
Optional.None -> True
|
||||
_ -> False
|
||||
Optional.None -> 1
|
||||
_ -> 0
|
||||
|
||||
increment x = x + 1
|
||||
increment x = x +_UInt64 1
|
||||
|
||||
increment 3
|
||||
|
Loading…
Reference in New Issue
Block a user