Last active
March 24, 2019 11:15
-
-
Save zwilias/f9f5f8fa7c6b2dbcadcc537c982035cd to your computer and use it in GitHub Desktop.
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 | |
type Extensible a = | |
{ count :: Int | a } | |
data State | |
= A (Extensible ( text :: String )) | |
| B (Extensible ( whatever :: String )) | |
updatePosition :: (forall a. Extensible a -> Extensible a) -> State -> State | |
updatePosition f state = | |
case state of | |
A x -> | |
A (f x) | |
B x -> | |
B (f x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment