Quick actions

cmd+k|ctrl+k

Navigation

Languages

ExistentialQuantification forall a. (...) vs (forall a. ...)

Snippet info

Language

Haskell

Visibility

public

Author

homam

Created

2016-10-26T21:36:17Z

Updated

2016-10-26T21:36:34Z

{-# LANGUAGE ExistentialQuantification, RankNTypes #-}

data List a = Nil | a ::: (List a)
data C c = forall c. C (List c)
data D d = D (forall d. List d)


main = do 
    let s = (3 :: Int) ::: Nil
    let a = C ((3 :: Int) ::: Nil)
    let b = D Nil
    let c = D (undefined ::: Nil)
    -- error: 
    -- let d = D ((3 :: Int) ::: Nil)
    -- let e = D (() ::: Nil)
    return ()
INFO