-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename ∘ to << and add >>, |> and <| functions #103
Conversation
085540e
to
826f67e
Compare
88449d1
to
290f67f
Compare
Stdlib/Data/List/Base.juvix
Outdated
@@ -219,7 +219,7 @@ syntax iterator concatMap {init := 0; range := 1}; | |||
--- Applies a function to every item on a ;List; and concatenates the result. | |||
--- 𝒪(𝓃), where 𝓃 is the number of items in the resulting list. | |||
concatMap {A B} (f : A -> List B) : List A -> List B := | |||
flatten ∘ map f; | |||
flatten << map f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we have >>
, I think it would be more readable to use it in most situations instead of <<
(the composition order of >>
from left to right seems more intuitive: we first map, then flatten).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed - I will change this. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
This PR replaces the unicode composition function name with
<<
and adds similar functions>>
,|>
and<|
. Inspired by elm.The
$
function is now called<|
.The
>>>
(builtin seq) function is now called>->
.The
>> : IO -> IO -> IO
function is now called>>>
.