Skip to content

Instantly share code, notes, and snippets.

@ion1
Created September 19, 2014 22:57
Show Gist options
  • Select an option

  • Save ion1/aee28007c0cef961d0fc to your computer and use it in GitHub Desktop.

Select an option

Save ion1/aee28007c0cef961d0fc to your computer and use it in GitHub Desktop.
-fdefer-type-errors
(a,b) = ("foo", "bar" + 42)
% ghci -fdefer-type-errors Foo.hs
[1 of 1] Compiling Main ( Foo.hs, interpreted )
Foo.hs:1:1: Warning:
Top-level binding with no type signature: a :: [Char]
Foo.hs:1:1: Warning:
Top-level binding with no type signature: b :: [Char]
Foo.hs:1:23: Warning:
No instance for (Num [Char]) arising from a use of ‘+’
In the expression: "bar" + 42
In the expression: ("foo", "bar" + 42)
In a pattern binding: (a, b) = ("foo", "bar" + 42)
Ok, modules loaded: Main.
λ> a
"foo"
λ> b
"*** Exception: Foo.hs:1:23:
No instance for (Num [Char]) arising from a use of ‘+’
In the expression: "bar" + 42
In the expression: ("foo", "bar" + 42)
In a pattern binding: (a, b) = ("foo", "bar" + 42)
(deferred type error)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment