Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 642 Bytes

fix_polymorhic_constructors.md

File metadata and controls

29 lines (23 loc) · 642 Bytes
  • Defer monomorphization for data constructors

    In 0.15.4 and earlier, the compiler monomorphizes type constructors early, yielding the following type:

    > :t Nothing
    forall (a1 :: Type). Maybe a1
    
    > :t { a : Nothing }
    forall (a1 :: Type).
      { a :: Maybe a1
      }

    With this change, the monomorphization introduced in #835 is deferred to only when it's needed, such as when constructors are used as values inside of records.

    > :t Nothing
    forall a. Maybe a
    
    > :t { a : Nothing }
    forall (a1 :: Type).
      { a :: Maybe a1
      }