Skip to content

Commit 3b41723

Browse files
authored
Merge branch 'main' into cd/2024-10-28-support-operations-on-exit-code
2 parents e1318ea + ff17f10 commit 3b41723

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

examples/08-tuples.hell

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ main = do
55

66
let (foo,bar) = (123, "foo")
77
Text.putStrLn bar
8+
9+
Monad.return ()

src/Hell.hs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,10 @@ data Forall where
328328
Final :: (forall g. Typed (Term g)) -> Forall
329329

330330
lit :: Type.Typeable a => a -> UTerm ()
331-
lit l = UForall HSE.noSrcSpan () [] (Final (Typed (Type.typeOf l) (Lit l))) [] (fromSomeStarType (SomeStarType (Type.typeOf l))) []
331+
lit = litWithSpan HSE.noSrcSpan
332+
333+
litWithSpan :: Type.Typeable a => HSE.SrcSpanInfo -> a -> UTerm ()
334+
litWithSpan srcSpanInfo l = UForall srcSpanInfo () [] (Final (Typed (Type.typeOf l) (Lit l))) [] (fromSomeStarType (SomeStarType (Type.typeOf l))) []
332335

333336
data SomeStarType = forall (a :: Type). SomeStarType (TypeRep a)
334337
deriving instance Show SomeStarType
@@ -611,7 +614,9 @@ desugarPolyQName qname treps =
611614
HSE.UnQual l (HSE.Symbol _ string)
612615
| Just (forall', vars, irep, _) <- Map.lookup string polyLits -> do
613616
pure (UForall l () treps forall' vars irep [])
614-
_ -> Left $ InvalidVariable $ HSE.prettyPrint qname
617+
HSE.Special l (HSE.UnitCon{}) ->
618+
pure $ litWithSpan l ()
619+
_ -> Left $ InvalidVariable $ show qname
615620

616621
desugarArg :: HSE.Pat HSE.SrcSpanInfo -> Either DesugarError (Binding, Maybe SomeStarType)
617622
desugarArg (HSE.PatTypeSig _ (HSE.PVar _ (HSE.Ident _ i)) typ) =

0 commit comments

Comments
 (0)