Created
December 11, 2015 14:53
-
-
Save ir4y/8d2e915579b954eea635 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
| import Focus | |
| import Array | |
| import Maybe | |
| atL Int -> a -> Focus (Array.Array a) a | |
| atL index default = Focus.create ((Maybe.withDefault default) << (Array.get index))\ | |
| (\f r -> (Array.set index | |
| (f (Maybe.withDefault default (Array.get index r))) | |
| r)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment