File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ import Data.Generic.Rep (class Generic)
57
57
import Data.Generic.Rep.Show (genericShow )
58
58
import Data.List (List )
59
59
import Data.List as List
60
+ import Data.List.NonEmpty as NEL
61
+ import Data.List.Types (NonEmptyList )
60
62
import Data.Maybe (Maybe (..))
61
63
import Data.Newtype (class Newtype , over , un )
62
64
import Data.Tuple.Nested (Tuple3 , (/\))
@@ -370,12 +372,12 @@ manyM p = tailRecM go List.Nil
370
372
aa <- oneM $ (Loop <$> p) <|> pure (Done unit)
371
373
pure $ bimap (_ List .: acc) (\_ -> List .reverse acc) aa
372
374
373
- someM :: forall a . Parser a -> ParserM (List a )
374
- someM p = List.Cons <$> oneM p <*> manyM p
375
+ someM :: forall a . Parser a -> ParserM (NonEmptyList a )
376
+ someM p = NEL .cons' <$> oneM p <*> manyM p
375
377
376
378
many :: forall a . Parser a -> Parser (List a )
377
379
many = manyM >>> fromM
378
- some :: forall a . Parser a -> Parser (List a )
380
+ some :: forall a . Parser a -> Parser (NonEmptyList a )
379
381
some = someM >>> fromM
380
382
381
383
-- | optparse-applicative supplies a rich completion system for bash,
You can’t perform that action at this time.
0 commit comments