CurryInfo: curry-repl-1.2.0 / REPL.Main.replOptions

definition:
replOptions :: ReplState
            -> [(String, ReplState -> String -> IO (Maybe ReplState))]
replOptions rst =
  [ ("v0"           , \r _ -> return (Just r { verbose      = 0     }))
  , ("v1"           , \r _ -> return (Just r { verbose      = 1     }))
  , ("v2"           , \r _ -> return (Just r { verbose      = 2     }))
  , ("v3"           , \r _ -> return (Just r { verbose      = 3     }))
  , ("v4"           , \r _ -> return (Just r { verbose      = 4     }))
  , ("path"         , setOptionPath                                   )
  , ("prompt"       , setPrompt                                       )
  , ("safe"         , \r _ -> return (Just r { safeExec     = True  }))
  , ("parser"       , \r a -> return (Just r { parseOpts    = a     }))
  , ("timeout"      , setTimeout                                      )
  , ("args"         , \r a -> return (Just r { rtsArgs      = a     }))
  -- , ("prelude"      , \r a -> return (Just r { preludeName  = a     }))
  , ("+bindings"    , \r _ -> return (Just r { showBindings = True  }))
  , ("-bindings"    , \r _ -> return (Just r { showBindings = False }))
  , ("+echo"        , \r _ -> return (Just r { withEcho     = True  }))
  , ("-echo"        , \r _ -> return (Just r { withEcho     = False }))
  , ("+show"        , \r _ -> return (Just r { withShow     = True  }))
  , ("-show"        , \r _ -> return (Just r { withShow     = False }))
  , ("+time"        , \r _ -> return (Just r { showTime     = True  }))
  , ("-time"        , \r _ -> return (Just r { showTime     = False }))
  ] ++
  concatMap setCmpOpt ccopts
 where
  ccopts = ccOpts (compiler rst)

  setCmpOpt (CCOption _ _ tags) = map setOptTag tags

  setOptTag opt@(ConstOpt tag _) =
    (tag,
     \r _ -> return (Just r { cmpOpts = map (replaceCompilerOption ccopts opt)
                                            (cmpOpts r) }))
  setOptTag (ArgOpt tag _ fo) = (tag, checkArg)
   where
    checkArg r a =
      maybe (skipCommand "Illegal option argument!")
            (\_ -> return (Just r { cmpOpts = map (replaceCompilerOption ccopts
                                                     (ArgOpt tag a fo))
                                                  (cmpOpts r) }))
            (fo a)
demand:
no demanded arguments
deterministic:
deterministic operation
documentation:
-- Returns a list of pairs of option names and the corresponding
-- action to set the option with a given parameter in the state.
failfree:
<FAILING>
indeterministic:
referentially transparent operation
infix:
no fixity defined
iotype:
{(_) |-> _}
name:
replOptions
precedence:
no precedence defined
result-values:
_
signature:
REPL.State.ReplState -> [(String, REPL.State.ReplState -> String
-> Prelude.IO (Prelude.Maybe REPL.State.ReplState))]
solution-complete:
operation might suspend on free variables
terminating:
possibly non-terminating
totally-defined:
possibly non-reducible on same data term