Last active
December 11, 2016 09:28
-
-
Save FrigoEU/b2ea85258d3245f5fdca1883640ceb70 to your computer and use it in GitHub Desktop.
Fail Instance with TypeString/TypeConcat
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
| module Main where | |
| import Prelude | |
| import Control.Monad.Eff.Console (log) | |
| class Serialize a where | |
| serialize :: a -> String | |
| instance cannotSerializeFunctions | |
| :: Fail ("Cannot serialize the function: " <> TypeString (a -> b) <> ". Functions can't be serialized.") | |
| => Serialize (a -> b) where | |
| serialize _ = "unreachable" | |
| infixl 6 type TypeConcat as <> | |
| main = do | |
| log (serialize ((+) 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment