lambda cube
This commit is contained in:
parent
971a2f151b
commit
014712c6c2
9 changed files with 678 additions and 0 deletions
19
content/posts/the-lambda-cube/WhatIThoughtDataKindsDid.hs
Normal file
19
content/posts/the-lambda-cube/WhatIThoughtDataKindsDid.hs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{-# LANGUAGE DataKinds #-}
|
||||
module WhatIThoughtDataKindsDid where
|
||||
|
||||
data Ty
|
||||
= A {field1 :: Int}
|
||||
| B {field2 :: Int}
|
||||
|
||||
someFunctionTakingB :: 'B -> Int
|
||||
someFunctionTakingB = field2
|
||||
|
||||
{-
|
||||
WhatIThoughtDataKindsDid.hs:8:24: error:
|
||||
• Expecting one more argument to ‘'B’
|
||||
Expected a type, but ‘'B’ has kind ‘Int -> Ty’
|
||||
• In the type signature: someFunctionTakingB :: 'B -> Int
|
||||
|
|
||||
8 | someFunctionTakingB :: 'B -> Int
|
||||
| ^^
|
||||
-}
|
||||
Loading…
Add table
Add a link
Reference in a new issue