Date: 2016-11-06 01:49 pm (UTC)
instance Applicative Parser where
  pure a = Parser $ \s -> [(a, s)]
  (Parser ps) <*> (Parser qs) = Parser $ \s -> [ (f a, t)
                                               | (f, s') <- ps s
                                               , (a,t) <- qs s'
                                               ]

instance Alternative Parser where
  empty = Parser $ const []
  (Parser ps) <|> (Parser qs) = Parser $ (++) <$> ps <*> qs
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

deniok: (Default)
deniok

February 2022

S M T W T F S
  12345
6789101112
13141516171819
20212223 242526
2728     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 15th, 2025 02:19 am
Powered by Dreamwidth Studios