Created
December 12, 2017 15:58
-
-
Save robkuz/8a29aacf064093c8f6589b8b397110c2 to your computer and use it in GitHub Desktop.
Some Code puzzle
This file contains 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
Given the following definitions | |
|>> : map/fmap | |
v: NonEmptyList<SomeRecord> | |
SomeRecord: {foo: Option<_>; bar: Option<_>; baz: Option<_>} | |
isSomeList: SomeRecord -> List<bool, string> | |
//string: the name of the field | |
//bool: if Some then true else false | |
What does this code do? | |
v | |
|>> isSomeList | |
|> concat | |
|> List.countBy id | |
|>> snd | |
|> distinct | |
|> length | |
|> ((=) 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment