blog/content/posts/the-lambda-cube/WhatIThoughtDataKindsDid.hs
2022-10-25 21:20:36 -07:00

19 lines
478 B
Haskell
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{-# 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
| ^^
-}