Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
Vorlesung 2015
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FFPiH
Vorlesung 2015
Commits
f9ba1925
Commit
f9ba1925
authored
9 years ago
by
Nicole Dresselhaus
Browse files
Options
Downloads
Patches
Plain Diff
added lecture3
parent
bcff3532
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
exampleCode/lecture3/MaybeIO.hs
+24
-0
24 additions, 0 deletions
exampleCode/lecture3/MaybeIO.hs
lecture3.pdf
+0
-0
0 additions, 0 deletions
lecture3.pdf
with
24 additions
and
0 deletions
exampleCode/lecture3/MaybeIO.hs
0 → 100644
+
24
−
0
View file @
f9ba1925
module
MaybeIO
where
import
Control.Applicative
data
MaybeIO
a
=
MaybeIO
{
runMaybeIO
::
IO
(
Maybe
a
)
}
instance
Functor
MaybeIO
where
fmap
f
=
MaybeIO
.
fmap
(
fmap
f
)
.
runMaybeIO
instance
Applicative
MaybeIO
where
pure
=
MaybeIO
.
pure
.
pure
f
<*>
x
=
MaybeIO
$
(
<*>
)
<$>
f'
<*>
x'
where
f'
=
runMaybeIO
f
x'
=
runMaybeIO
x
instance
Monad
MaybeIO
where
return
=
pure
x
>>=
f
=
MaybeIO
$
x'
>>=
runMaybeIO
.
mb
.
fmap
f
where
x'
=
runMaybeIO
x
mb
::
Maybe
(
MaybeIO
a
)
->
MaybeIO
a
mb
(
Just
a
)
=
a
mb
Nothing
=
MaybeIO
$
return
Nothing
This diff is collapsed.
Click to expand it.
lecture3.pdf
0 → 100644
+
0
−
0
View file @
f9ba1925
File added
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment