-- __________ __________ __________ __________ ________ -- / _______/ / ____ / / _______/ / _______/ / ____ \ -- / / _____ / / / / / /______ / /______ / /___/ / -- / / /_ / / / / / / _______/ / _______/ / __ __/ -- / /___/ / / /___/ / / / / /______ / / \ \ -- /_________/ /_________/ /__/ /_________/ /__/ \__\ -- -- Functional programming environment, Version 2.21 -- Copyright Mark P Jones 1991. -- -- Minimal Gofer prelude for experimentation with different approaches -- to standard operations. -- -- Any Gofer prelude file should typically include at least the following -- definitions: infixr 5 : infixr 3 && infixr 2 || (&&), (||) :: Bool -> Bool -> Bool False && _ = False -- (&&) and (||) names predefined in Gofer True && x = x False || x = x True || _ = True flip :: (a -> b -> c) -> b -> a -> c flip f x y = f y x error :: String -> a error s | False = error s -- I/O functions and definitions: -- This is the minimum required for bootstrapping and execution of -- interactive programs. data Request = -- file system requests: ReadFile String | WriteFile String String | AppendFile String String -- channel system requests: | ReadChan String | AppendChan String String -- environment requests: | Echo Bool data Response = Success | Str String | Failure IOError data IOError = WriteError String | ReadError String | SearchError String | FormatError String | OtherError String type Dialogue = [Response] -> [Request]