This commit is contained in:
Arya Irani 2018-06-05 17:40:15 -04:00
parent e7d45eac41
commit 25c52d169d
4 changed files with 7 additions and 5 deletions

View File

@ -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"

View File

@ -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

View File

@ -97,6 +97,7 @@ executable bootstrap
hs-source-dirs: src
other-modules:
Unison.ABT
Unison.Builtin
Unison.Codecs
Unison.DataDeclaration
Unison.FileParser

View File

@ -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