Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[Haskell] 1.) Rewrite prob1 so that it uses >>= instead of do notation. Please use >>= , not >> 2.) Rewrite prob2 so it uses

[Haskell]

image text in transcribed

1.) Rewrite prob1 so that it uses >>= instead of do notation. Please use >>= , not >>

2.) Rewrite prob2 so it uses do notation

3.) Modify prob3 so it does the same computations as prob2, except with explicit state-passing

module Basics where import Control.Monad.State.Lazy probl:: 1o [integer] probl = do putStrin "probl" return [1,2,3] prob2 : State Integer Integer prob2 = get >>= (\ x-> put (x + x) >> return 1) type sta s a = s-> (sa) prob3 : Sta Integer Integer prob3 s (ss)--fill this in reverseArgs : 10 [String] revers eArgs = return [] getFirstArgif: IO (Maybe String) getFirstArgf = return Nothing -(Unix) Basics.hs All L16SVN-29479-(Haskell1nteractive lnd) Welcame to GNU Emacs, a part of the GNU operating system

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions