Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Fredrik Wieczerkowski
curry-libs
Commits
63eaecb7
Commit
63eaecb7
authored
Jul 18, 2019
by
Kai-Oliver Prott
Browse files
Optimize default implementations in Alternative class
parent
f4aaf9ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Prelude.curry
View file @
63eaecb7
...
...
@@ -1234,14 +1234,14 @@ class Applicative f => Alternative f where
some v = some_v
where
many_v = some_v <|> pure []
some_v =
liftA2 (:) v
many_v
some_v =
(:) <$> v <*>
many_v
-- | Zero or more.
many :: f a -> f [a]
many v = many_v
where
many_v = some_v <|> pure []
some_v =
liftA2 (:) v
many_v
some_v =
(:) <$> v <*>
many_v
instance Alternative [] where
empty = []
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment