Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
curry
kics
Commits
da008146
Commit
da008146
authored
Nov 01, 2007
by
bbr
Browse files
io action to get the current nr of choices on top level
parent
8e074278
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Store.hs
View file @
da008146
module
Store
(
Store
,
emptyStore
,
addToStore
,
fromStore
,
emptyStore
,
addToStore
,
fromStore
,
storeSize
,
trace
,
vtrace
,
vtrace'
,
...
...
@@ -63,4 +63,7 @@ addToStore (Store a) m x = trace ("add binding "++show m)
(
Store
(
insert
(
deref
m
)
x
a
))
fromStore
::
Store
->
OrRef
->
Maybe
Int
fromStore
(
Store
a
)
n
=
lookup
(
deref
n
)
a
\ No newline at end of file
fromStore
(
Store
a
)
n
=
lookup
(
deref
n
)
a
storeSize
::
Store
->
Int
storeSize
(
Store
st
)
=
size
st
\ No newline at end of file
src/lib/ExternalFunctionsUnsafe.hs
View file @
da008146
...
...
@@ -128,3 +128,9 @@ try x _ = case consKind x of
orsWithOrRef
::
Curry
a
=>
C_OrRef
->
List
a
->
Result
a
orsWithOrRef
(
C_OrRef
r
)
xs
_
=
branching
r
(
toHaskellList
xs
)
nrOfChoices
::
Result
(
C_IO
C_Int
)
nrOfChoices
st
=
C_IO
(
\
st'
->
Prelude
.
return
(
IOVal
(
toCurry
(
max
(
size'
st
)
(
size'
st'
)))))
where
size'
=
maybe
0
storeSize
src/lib/Unsafe.curry
View file @
da008146
...
...
@@ -11,7 +11,7 @@ module Unsafe(unsafePerformIO,trace,spawnConstraint,isVar,identicalVar,
showAnyTerm,showAnyQTerm,showAnyExpression,showAnyQExpression,
readsAnyUnqualifiedTerm,readAnyUnqualifiedTerm,readsAnyQTerm,
readAnyQTerm,
OrRef,try,ors
OrRef,try,ors
WithOrRef,nrOfChoices
)
where
...
...
@@ -171,4 +171,7 @@ try :: a -> Either a (OrRef,[a])
try external
orsWithOrRef :: OrRef -> [a] -> a
orsWithOrRef external
\ No newline at end of file
orsWithOrRef external
nrOfChoices :: IO Int
nrOfChoices external
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment