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
bcff3532
Commit
bcff3532
authored
9 years ago
by
Nicole Dresselhaus
Browse files
Options
Downloads
Patches
Plain Diff
Vorlesung 2
parent
f4e8d17e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
exampleCode/lecture2/state.hs
+27
-0
27 additions, 0 deletions
exampleCode/lecture2/state.hs
lecture2.pdf
+0
-0
0 additions, 0 deletions
lecture2.pdf
with
27 additions
and
0 deletions
exampleCode/lecture2/state.hs
0 → 100644
+
27
−
0
View file @
bcff3532
module
Main
where
{- Hier eine Passende Definition der State-Monade einfügen... -}
{- z.B. Control.Monad.Trans.State aus dem transformers-package -}
{- oder Control.Monad.State aus dem veralteten mtl-package -}
type
CountState
=
(
Bool
,
Int
)
startState
::
CountState
startState
=
(
False
,
0
)
play
::
String
->
State
CountState
Int
play
[]
=
do
(
_
,
score
)
<-
get
return
score
play
(
x
:
xs
)
=
do
(
on
,
score
)
<-
get
case
x
of
'C'
->
if
on
then
put
(
on
,
score
+
1
)
else
put
(
on
,
score
)
'A'
->
if
on
then
put
(
on
,
score
-
1
)
else
put
(
on
,
score
)
'T'
->
put
(
False
,
score
)
'G'
->
put
(
True
,
score
)
_
->
put
(
on
,
score
)
play
xs
main
=
print
$
runState
(
play
"GACAACTCGAAT"
)
startState
-- -> (-3,(False,-3))
This diff is collapsed.
Click to expand it.
lecture2.pdf
0 → 100644
+
0
−
0
View file @
bcff3532
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