Created
October 29, 2018 01:57
-
-
Save sevanspowell/964b96215441d3f11359d5ba1f20123d to your computer and use it in GitHub Desktop.
ScopedTypeVariables unexpected
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
• Couldn't match type ‘a’ with ‘a1’ | |
‘a’ is a rigid type variable bound by | |
the type signature for: | |
mogel :: forall a. Show a => a -> (String, a) | |
at src/Types.hs:105:1-48 | |
‘a1’ is a rigid type variable bound by | |
the type signature for: | |
b :: forall a1. Show a1 => Maybe a1 | |
at src/Types.hs:108:5-39 | |
Expected type: Maybe a1 | |
Actual type: Maybe a | |
• In the expression: Just a | |
In an equation for ‘b’: b = Just a | |
In the expression: | |
let | |
b :: forall a. (Show a) => Maybe a | |
b = Just a | |
in maybe ("", a) (\ aa -> (show aa, aa)) b | |
• Relevant bindings include | |
b :: Maybe a1 (bound at src/Types.hs:109:5) | |
a :: a (bound at src/Types.hs:106:7) | |
mogel :: a -> (String, a) (bound at src/Types.hs:106:1) | |
| | |
109 | b = Just a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE ScopedTypeVariables #-} | |
fn :: forall a . (Show a) => a -> (String, a) | |
fn a = | |
let | |
b :: forall a . (Show a) => Maybe a | |
b = Just a | |
in maybe ("", a) (\aa -> (show aa, aa)) b | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment