module Parser (parseLambda, parseLine) where import Control.Monad import…
- User
module Parser (parseLambda, parseLine) where
import Control.Monad import Control.Applicative import Data.Char
import Lambda import Binding
newtype Parser a = Parser { parse :: String -> Maybe (a, String) }
instance Functor Parser where fmap f mp = do x <- mp return (f x) instance Applicative Parser where pure x = Parser \input -> do (f, rest1) <- pf input (x, rest2) <- px rest1 return (f x, rest2)
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.