ld be a standardized
bytecode language for the browser; something that can be JITted
efficiently while guaranteeing safety/security. This way, the
compilation chain
Haskell -> bytecode -> browser
would finally be viable.
Best regards,
Heinrich Apfelmus
--
h
David Barbour wrote:
Heinrich Apfelmus wrote:
Even then, events and behaviors are "one abstraction level too low". In my
opinion, you are better off with a library/approach geared directly towards
incremental computations.
I believe behaviors are precisely the 'right' abs
are "one abstraction level too low". In my opinion, you
are better off with a library/approach geared directly towards
incremental computations.
[1]: http://haskell.org/haskellwiki/Reactive-banana
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
_
quivalently:
evalState (sequence . repeat . state $ \s -> (s,s+1)) 0
Thanks, I've changed it.
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
ot;Operational Monad
Tutorial"
http://apfelmus.nfshost.com/articles/operational-monad.html
The link to the Cont monad is explained at the very end.
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Hask
r you.
I was using the names for a Show instance. I am assuming there is no
syntax sugar to recover the name of the variable used in a binder as a
String.
Ah, good point. There is no referentially transparent way to recover the
name of a variable.
Best regards,
Heinrich Apfelmu
ule
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
ance, the generalization
read :: Read a => String -> a
- showDouble :: Double -> String
+ showDouble :: Floating a => a -> String
will break the program
foo :: String -> String
foo = showDouble . read
That said, is it true that *removing* a class constraint will
ion A.B.C when
introducing this change?
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
your code, though. What happens if you change it to
map_ applyAction sas
return [1..100]
? If this still throws a stack overflow, then problem is in the part of
the code that consumes said list.
Best regards,
Heinrich Apfelmus
--
htt
s and
code. I interpret this as a sign that my library is easy to understand
(if you know Applicative Functors, that is) even though a key part of
the documentation is still missing.
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshos
d any further than that. Of
course, the resulting text will be very useful to readers with a high
attention span, too.)
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.h
id is that you can use one and the
same finger tree implementation for a variety of data structures.
Practically every tree-based data structure can be obtained this way.
See also
http://apfelmus.nfshost.com/articles/monoid-fingertree.html
Best regards,
Heinrich Apfelmus
--
Heinrich Apfelmus wrote:
Dear Haskellers,
Can GUI programming be liberated from the IO monad? Functional Reactive
Programming (FRP) promises as much, and I'm trying to make this dream a
reality with my [reactive-banana][] library. Having released version
0.4.0.0, I am now looking for ex
rrows is equal in
expressiveness to the approach I took in reactive-banana .
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Henning Thielemann wrote:
Heinrich Apfelmus wrote:
Question: how would you actually like to describe the guitar simulator
at a high-level? Did you already wish for some specific combinators?
Assume that you had something like reactive-banana available and
imagine that there were a benevolent
Henning Thielemann wrote:
Heinrich Apfelmus wrote:
Could you expand a little on your arrow-like stream processors? What
do the arrows look like,
data SF a b = SF (a -> (b, SF a b))
?
My stream processors are not Arrows, because 'first' cannot be
implemented. Howev
Henning Thielemann wrote:
Heinrich Apfelmus wrote:
Can GUI programming be liberated from the IO monad? Functional
Reactive Programming (FRP) promises as much, and I'm trying to make
this dream a reality with my [reactive-banana][] library. Having
released version 0.4.0.0, I am now lo
David Virebayre wrote:
Heinrich Apfelmus:
I want to hear!
Just a description. :) You can also mention why you find it interesting etc.
Well I have an old program sitting around. Anyway, it's very simple :
The GUI has
- a window with a menu bar, 2 directory selects (source and
-side Haskell, the latency is just too big.
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Dmitriy Nikitinskiy wrote:
Heinrich Apfelmus пишет:
Do you know any *small GUI programs* that you would *like* to see
*implemented with Functional Reactive Programming?*
Maybe realize on FRP one of following bored examples:
CRUD table: create, update, delete records in table (for example
Chris Smith wrote:
Heinrich Apfelmus wrote:
Do you know any *small GUI programs* that you would *like* to see
*implemented with Functional Reactive Programming?*
This isn't really a specific application, but what I'd like to see most
from FRP is an example of something that invol
Ketil Malde wrote:
Heinrich Apfelmus writes:
Do you know any *small GUI programs* that you would *like* to see
*implemented with Functional Reactive Programming?*
I don't know if this fits the bill, but a tool that I'd like to see is
plotting for one or more live streams of data.
Jason Dagit wrote:
Heinrich Apfelmus wrote:
Do you know any *small GUI programs* that you would *like* to see
*implemented with Functional Reactive Programming?*
I would love to hear your examples, so that I can try to convert them to FRP
style and test my library against them!
How about a
David Virebayre wrote:
Heinrich Apfelmus wrote:
Do you know any *small GUI programs* that you would *like* to see
*implemented with Functional Reactive Programming?*
I may have an example.
I want to hear!
I would love to hear your examples, so that I can try to convert them to FRP
style
[zipedit]: http://byorgey.wordpress.com/2008/06/21/zipedit/
[hbeat]: http://dockerz.net/twd/hBeat
[midi streams]: http://hackage.haskell.org/package/streamed
[hwn]: http://www.haskell.org/haskellwiki/Haskell_Weekly_News
Best regards,
Heinrich
elism PAR. Basically, the SYNCHLIST primitive only allows
simultaneous access to the input stream and the parallelism is used to
make that simultaneity happen.
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
gards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
want to run
the command
ghc-pkg hide offending-package
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
k I should have another
look now, thanks for the suggestion.
I'm currently working on a variant of Elliott's and Hudak's original FRP
model. See also:
http://hackage.haskell.org/package/reactive-banana
http://apfelmus.nfshost.com/blog.html#functional-reactive-programming-frp
B
org/operational/
In particular, the examples
WebSessionState.lhs
TicTacToe.hs
PoorMansConcurrency.hs
show how to suspend and resume the control flow. Feel free to request
additional examples.
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
like during or fork , but I don't
know whether that's the best way to go about it. It's worth trying, but
keep in mind that the goal is to have an expressive set of combinators,
not to shoehorn everything into monads.)
Best regards,
Hein
Emil Axelsson wrote:
Heinrich Apfelmus wrote:
Since every module of my DSL depends on the same
global variable, only two things should happen:
* Reloading a module does not reload the global counter. Everything is
fine.
* Reloading a module does reload the global counter. This forces *all
Unfortunately, it forces Typeable
contraints on polymorphic combinators.
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
ion][2]. I would love the ability to install it
locally and to link to it from the Haddock documentation.
[1]: http://hackage.haskell.org/package/operational
[2]: http://projects.haskell.org/operational/Documentation.html
Best regards,
Heinrich Apfelmus
--
http://apfelmus.n
st regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
the latest problem is that ghci is unable to link
libstdc++. But the crash problem is probably still there.
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailma
ished cross-platform GUI toolkits is that they
embed a lot of wisdom about platform quirks (Cocoa is particularly
annoying) that you would have to solve again.
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing
lements from scratch.
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
mple program that you can try out.
It might be worth to include the extra hoops (EnableGUI) in the GLFW
package.
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
settled on the
Producer/Transformer/Consumer trilogy.
I'd love to hear thoughts on the issue, especially from David.
I vastly prefer the names Producer/Transformer/Consumer over the others.
Then again, I never quite understood what Iteratees were all about in
the first place.
Best regard
Ryan Ingram wrote:
Heinrich Apfelmus wrote:
However, even in a demand-driven implementation, there is one optimization
that I would like make: when there are multiple external events, say e1 and
e2, the network splits into subnetworks that react only to one of the
inputs. For instance, your
Ryan Ingram wrote:
Apfelmus, I hope you don't abandon your efforts, at least for the selfish
reason that I enjoy reading your blog entries about trying to implement it!
:D My reasoning was that a temporary demand-driven implementation would
allow me to release the library sooner; I
st.) See also
http://apfelmus.nfshost.com/blog/2011/04/24-frp-push-driven-sharing.html
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
he compiler that you fulfilled that proof
obligation! (At least, I don't see any obvious one. Maybe a clever abuse
of parametricity helps.) It might be an option in Agda, though.
In that light, it is entirely reasonable that you have to use
unsafePerformIO .
Best regards,
Heinrich
* want to write whole programs that way. At some
point, you need something that works at another level than pure
functions. What the *hell* do you do?
I think a better invective would be "amazing".
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
s simply a dummy variable to index different FRP implementations.
The problem with this is that I need the FlexibleContexts extension to
do that. There goes Haskell2010 compatibility.
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
_
his own programs as well. Since the
implementation makes heavy use of IO, it is a bit harder to test
automatically, so the model might be useful to have.
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing li
http://hackage.haskell.org/package/hmatrix
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
ge.
Note that GHC has long supported existential types, just not the
explicit syntax.
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
s f -> c) -> c
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
correctly, the EHC from Utrecht supports first-class existential
quantification ). You have to encode it in some way, for instance with a
data type
data Exists f = forall c . Exists (f c)
takeC :: Int -> Compoz a b -> Exists (Compoz a)
xists c. Compoz c b)
run :: Compoz a b -> (a -> b)
Of course, you will have to wrestle with the existential types for
takeC and dropC a bit, but that shouldn't be much of a problem. For
instance, you can fuse these functions into runLayers and hide the
existential typ
works fine, though.
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
, etc.
to help prove correctness. Admittedly, I don't know how many people
actually do so...
I did, I did!
http://projects.haskell.org/operational/Documentation.html#proof-of-the-monad-laws-sketch
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
g my code in such a way that correctness becomes
obvious.
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Will Ness wrote:
Heinrich Apfelmus writes:
Here an example where the VIP merge would give a different result
bad = tfold $ (1:10:undefined) : (2:3:5:undefined) : (4:undefined) :
error "bad"
We have
ghci> bad
[1,2*** Exception: bad
but the VIP
Will Ness wrote:
Heinrich Apfelmus writes:
Here an example where the VIP merge would give a different result
bad = tfold $ (1:10:undefined) : (2:3:5:undefined) : (4:undefined) :
error "bad"
We have
ghci> bad
[1,2*** Exception: bad
but the VIP
r the time and space complexity stays the same. (Which is not as
bad as it sounds, since we didn't know them well in the first place
anyway). More worryingly, changing the tree shape now affects correctness.
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
_
page once the link works again.)
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
whitespace from
Haskell. Haskell itself (or rather the design committee) got the idea
from SASL (1976) and Miranda (1986), though it goes way back to the
1960s, as described in section 4.1 "Layout" of
http://www.haskell.org/haskellwiki/History_of_Haskell
Regards,
Heinri
ize
different first characters.
* Don't do recursion yourself, use premade combinators like many1 etc.
instead.
* lookAhead is very useful for avoiding capturing input in the second
argument of manyTill
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
) and code
everything that comes up on the fly. There is no better way to ensure
usability of an application than to write it while heavily using it (and
aiming for a large usability / features ratio).
Regards,
Heinrich Apfelmus
--
http://apfelmus.n
ever got around to finishing it:
http://www.haskell.org/haskellwiki/Haskell_a_la_carte
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Malcolm Wallace wrote:
Heinrich Apfelmus wrote:
Personally, I would be much happier with the slogan "HXT = XML
transformations with filters". Browsing through Manuel's thesis, I
discover that your combinators are quite slick ( >>> , choiceA , when,
guards ), it
C. McCann wrote:
Heinrich Apfelmus wrote:
Combined with >>= / >> you have multiple reading direction in the same
expression, as in
expression ( c . b . a ) `liftM` a1 >>= a2 >>= a3
reading order 6 5 41 2 3
That's why I
;- f x `orElse` deep f x]
where
[] `orElse` ys = ys
xs `orElse` _ = xs
which can also be written as
deep f xml = do
x <- children xml
f x `orElse` deep f x
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
1 2 3
So that could be one reason.
That's why I'm usually using =<< instead of >>= .
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
://www.haskell.org/HaXml/icfp99.html
but it appears to me that representing them as
type Filter a b = a -> [b]
allows the use of the list monad, which would highlight the similarity
between list comprehensions and working with XML trees.
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.
ceed yet.
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
sonally, I revisit projects I value a lot every month anyway, which
boils down to a larger share in the end.
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailma
external constraints, but it is a more forthright
form of showing that your work is valued than a silent download or
virtual nod.
[1]: http://flattr.com
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Hask
(The link doesn't seem to work, only http://gwolf.org/blog is available.)
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
aditya siram wrote:
Ok, I feel dumb. I have the slides hosted elsewhere now and I can't
figure out how to change the Reddit link. Any help is appreciated!
You can't change the link on Reddit, but you can delete the old
submission and make a new one.
Regards,
Heinrich Apfelmu
today.
I would recommend against MacLane (unless you are indeed a working
mathematician), his choice of topics and examples does not really help
understanding the Haskell side of category theory.
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
__
erate new keys
with the same cipher algorithm.
All examples that use buildKeyPair and type classes can be
reformulated in terms of Key with this additional field. That's
because buildKeyPair actually expects a type argument; the cipher
filed merely shifts that argument to the
en read.
[1]:
http://www.reddit.com/r/haskell/comments/ar4wb/understanding_iteratees/c0j0f3r
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Daniel Fischer wrote:
Heinrich Apfelmus wrote:
Daniel Fischer wrote:
For many hashing or de/encryption algorithms, chunking is more natural
than single-character access.
Even when the chunk lengths are unpredictable? After all, unlike with
fread in C, you can't request the next chu
encrypt :: B.ByteString -> B.ByteString,
decrypt :: B.ByteString -> B.ByteString,
keyLength :: BitLength,
serialize :: B.ByteString}
rsa :: RandomGen g => BitLength -> g -> ((Key,Key), g)
Regards,
Heinric
Daniel Fischer wrote:
John Lato wrote:
Heinrich Apfelmus wrote:
Do you have an example where you want chunking instead of single
character access?
I am unable to think of any examples where you want chunking for any
reason other than efficiency.
For many hashing or de/encryption algorithms
Nicolas Pouillard wrote:
Heinrich Apfelmus wrote:
There are also enumerators and enumeratees. I think that
purpose of enumerator =
run an iteratee on multiple sources
(i.e. first part of the input from a Handle ,
second part from a String )
I would say
Jason Dagit wrote:
Heinrich Apfelmus wrote:
I'm curious, can you give an example where you want to be explicit about
chunking? I have a hard time imagining an example where chunking is
beneficial compared to getting each character in sequence. Chunking
seems to be common in C for reaso
gt;>= k) = runString (k $ null cs) cs
-- an iteratee that counts the number of elements in the input
count :: Monad m => Iteratee m Int
count = go 0
where
go n = eof >>= \b -> case b of
True -> return n
False -&
edu/webs/people/okasaki/jfp98.ps
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
ratee . return . Continue $ go []
where
go xs EOF= Yield xs EOF
go xs (Chunk ys) = Continue $ go (xs++ys)
(using the API from http://ianen.org/articles/understanding-iteratees/ )
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
__
mString (xs ++ ys) = fromString ys . fromString xs
assuming a function
fromString :: String -> Enumerator
To get an actual result from an Iteratee, we only need a way to run it
on the empty stream.
runOnEmptyString :: Iteratee a -> Maybe a
Regards,
Heinrich
Luke Palmer wrote:
Heinrich Apfelmus wrote:
Conal Elliott wrote:
For anyone interested in iteratees (etc) and not yet on the iteratees
mailing list.
I'm asking about what iteratees *mean* (denote), independent of the
various implementations.
In my world view, iteratees are just a mo
is something that should be left to the
iteratee abstraction.
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Ertugrul Soeylemez wrote:
Heinrich Apfelmus wrote:
In particular, the World -> (a,World) model is unsuitable even without
concurrency because it cannot distinguish
loop, loop' :: IO ()
loop = loop
loop' = putStr "c" >> loop'
I interpret the
del" to be the operational semantics presented
in the tutorial paper.
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
also
R Backhouse, P Jansson, J Jeuring, L Meertens
Generic Programming - An Introduction -
http://www.cse.chalmers.se/~patrikj/poly/afp98/
A corresponding chapter in the wikibook ("Datatype algebra") has not
been written, so far.
Regards,
Heinrich Apfelmus
--
http://
, say
product [1..5] -> 1 * product [2..5] -> .. -> 120
is a proof that the initial and the final expression denote the same value.
The Curry-Howards correspondence is about the type system, viewing types
as logical propositions and programs as their proofs.
Regards,
Heinrich
solve such problems.
As Michael already mentioned, the problem is undecidable in general
since it includes group rings.
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.o
Gregory Crosswhite wrote:
Heinrich Apfelmus wrote:
Gregory Crosswhite wrote:
You're correct in pointing out that f uses memoization inside of
itself to cache the intermediate values that it commutes, but those
values don't get shared between invocations of f; thus, if you call
memo table might get
reconstructed redundantly. (However, there are other strategies for
memoization that are persistent across calls.)
It should be
f = \n -> memo ! n
where
memo = ..
so that memo is shared across multiple calls like f 1 , f 2 etc.
Regards,
Hein
too complicated for you and your graphs are really small, you
can also use a toy implementation like
type Graph = [(Node, -- Department
[Node]) -- List of Departments it shares revenue to
]
To test whether a graph has cycles ("looping mapping"), you
t (a * x)
^^ List involves a fixed point
So, to find the derivate, you have to calculate the derivative of List
first:
List' x = List x * List x
and then you can use the chain rule to find DTreeF .
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
__
r is a *list* of these things:
ContextDTree a = List (DList (a * DTree a) * a)
After all, what you describe is only the context of DTree a within a
single level, but it might be many levels down in the tree.
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
__
Regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
101 - 200 of 873 matches
Mail list logo