Hello,
I see the term free monad quite a lot, but don't really see an
explanation what a free monad is. What sets a monad free and why in this
day and age are there unfree monads?
Günther
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Given any functor you can get a monad for free!
data Free f a = Either a (f (Free f a))
Not sure about unfree, but there are cofree comonads that are pretty closely
related, and give you a comonad given a functor:
data Cofree f a = (a, f (Cofree f a))
I'm sure the more categorically minded can
xxxMain = do
timeout - getEnv xxx_TIMEOUT
case timeout of
Just str | [(t, _)] - reads str - do
addTimeout t (hPutStrLn stderr *** TIMEOUT _exit 1)
return ()
_ - return ()
...
What does the `|` mean in Just str | [(t, _)] - reads str ?
Is it a
Hello Daniel,
that looks lovely, but it doesn't help me much :)
Günther
Am 27.02.10 10:06, schrieb Daniel Peebles:
Given any functor you can get a monad for free!
data Free f a = Either a (f (Free f a))
Not sure about unfree, but there are cofree comonads that are pretty
closely related,
On Sat, Feb 27, 2010 at 5:07 PM, zaxis z_a...@163.com wrote:
xxxMain = do
timeout - getEnv xxx_TIMEOUT
case timeout of
Just str | [(t, _)] - reads str - do
addTimeout t (hPutStrLn stderr *** TIMEOUT _exit 1)
return ()
_ - return ()
...
What
On Feb 27, 2010, at 04:07 , zaxis wrote:
xxxMain = do
timeout - getEnv xxx_TIMEOUT
case timeout of
Just str | [(t, _)] - reads str - do
addTimeout t (hPutStrLn stderr *** TIMEOUT _exit 1)
return ()
_ - return ()
...
What does the `|` mean in Just
On Saturday 27 February 2010 3:54:25 am Günther Schmidt wrote:
I see the term free monad quite a lot, but don't really see an
explanation what a free monad is. What sets a monad free and why in this
day and age are there unfree monads?
Free structures originate (I think) in algebra. There
Daniel Fischer wrote:
Ishaaq Chandy wrote:
If this question sounds a bit noob-ish, that would be because I am one -
so apologies in advance!
I have functions that look something like these:
f1 :: [a] - [b]
f1 xs = [foo [x1, x2] |
x1 - xs,
x2 - bar x1,
baz x1 /= baz x2]
Günther Schmidt wrote:
Daniel Peebles wrote:
Given any functor you can get a monad for free!
data Free f a = Either a (f (Free f a))
that looks lovely, but it doesn't help me much :)
Alas, that you get one for free is not the reason why it's called the
free monad. Rather, for algebraic
On 27 February 2010 04:44, Brandon S. Allbery KF8NH allb...@ece.cmu.edu wrote:
As I read that, the leading underscore doesn't export anything; it just
suppresses any unused warning for the symbol (which is consistent with the
other uses of leading underscore in warnings; it's also consistent
Hi,
currently when one install a cabal package it compiles it and then install
generated binaries. I wonder whether or not it would be useful to have
pre-compiled binaries as many package managers usually do (e.g. apt). I
often think that would save some time on the expense of a busier hackage
Diego Souza wrote:
Hi,
currently when one install a cabal package it compiles it and then
install generated binaries. I wonder whether or not it would be useful
to have pre-compiled binaries as many package managers usually do
(e.g. apt). I often think that would save some time on the
Am Samstag 27 Februar 2010 16:39:27 schrieb Andrew Coppin:
Diego Souza wrote:
Hi,
currently when one install a cabal package it compiles it and then
install generated binaries. I wonder whether or not it would be useful
to have pre-compiled binaries as many package managers usually do
Hello!
I need to list all currently mounted filesystems and get some stats like
total space, free space, mount point and physical device.
Is there any library capable of obtaining such information from OS itself?
Parsing output of 'df' is locale-dependent and error-prone (because of locale
On Sat, Feb 27, 2010 at 9:29 AM, Brandon S. Allbery KF8NH
allb...@ece.cmu.edu wrote:
On Feb 27, 2010, at 04:07 , zaxis wrote:
xxxMain = do
timeout - getEnv xxx_TIMEOUT
case timeout of
Just str | [(t, _)] - reads str - do
addTimeout t (hPutStrLn stderr *** TIMEOUT _exit
Job Vranish wrote:
I was using STRefs the other day and I ran across a case where I
really wanted the ability to save the state of all my references,
execute some action, and then restore the state later if needed.
I didn't find anything that does this on hackage so I implemented a
small
Eugene Dzhurinsky wrote:
Hello!
I need to list all currently mounted filesystems and get some stats like
total space, free space, mount point and physical device.
Is there any library capable of obtaining such information from OS itself?
Parsing output of 'df' is locale-dependent and
On Sat, Feb 27, 2010 at 11:53 AM, Andrew Coppin andrewcop...@btinternet.com
wrote:
If you use something like the State or Reader monad, it becomes trivial to
temporarily modify the carried state. But maybe something like this is
occasionally useful. (In particular, it seems to allow you to
Eugene Dzhurinsky b...@redwerk.com wrote:
Hello!
I need to list all currently mounted filesystems and get some stats
like total space, free space, mount point and physical device.
Is there any library capable of obtaining such information from OS
itself? Parsing output of 'df' is
Job Vranish wrote:
On Sat, Feb 27, 2010 at 11:53 AM, Andrew Coppin
andrewcop...@btinternet.com mailto:andrewcop...@btinternet.com wrote:
Why an IORef? Why not an STRef? Then you won't need unsafeIOToST.
(And since the type system forces a ContextRef to exist in only
one state
One somewhat neat thing about Haskell is that you can say
case list of
[[x], [y,_], [z,_,_]] - x + y + z
_ - 0
In Java, you'd have to write something like
if (list.length() == 3)
{
List t1 = list.at(0);
if (t1.length() == 1)
{
int x = t1.at(0);
List t2 = list.at(1);
A humble suggestion: Have a *lazy* to list method for your *lists, arrays,
sets, etc.* and use the nice list-only version.
On 27 February 2010 18:11, Andrew Coppin andrewcop...@btinternet.comwrote:
One somewhat neat thing about Haskell is that you can say
case list of
[[x], [y,_],
Ozgur Akgun wrote:
A humble suggestion: Have a *lazy* to list method for your /lists,
arrays, sets, etc./ and use the nice list-only version.
Yeah, that works quite nicely.
It won't work for arbitrarily complex structures, however. My main point
was that if you make the constructors abstract
Hi all,
I have a question about cpp, c2hs and cabal. The short version:
What can I put in my cabal file to get -cppopts=-U__BLOCKS__ passed
as an argument in calls to c2hs?
Longer story:
I need to set up my cabal file so that c2hs gets this extra option to
make things build smoothly on some
Am Samstag 27 Februar 2010 21:27:27 schrieb Chris Casinghino:
Hi all,
I have a question about cpp, c2hs and cabal. The short version:
What can I put in my cabal file to get -cppopts=-U__BLOCKS__ passed
as an argument in calls to c2hs?
Maybe
cc-options: -U__BLOCKS__
is worth a try.
Andrew Coppin andrewcop...@btinternet.com wrote:
Ozgur Akgun wrote:
A humble suggestion: Have a *lazy* to list method for
your /lists, arrays, sets, etc./ and use the nice list-only version.
Yeah, that works quite nicely.
It won't work for arbitrarily complex structures, however. My
hi, i'm writing a Haskell View Server for CouchDB.
it communicates with couchdb over stdin and stdout. it gets JSON encoded
haskell code, compiles it (like on
http://www.haskell.org/haskellwiki/GHC/As_a_library), gets values, runs
the given code over the given values and writes the results
Eugene,
The only Linux function that can do this is `statvfs`. But binding to
it weren't implemented in the current libraries.
Year ago I implemented function that queries free size of the mounted
filesystem. The file is attached. To get other parameters you should
only extend `peek` function of
On Feb 27, 2010, at 11:47 , Eugene Dzhurinsky wrote:
Is there any library capable of obtaining such information from OS
itself?
Parsing output of 'df' is locale-dependent and error-prone (because
of locale
settings, output settings etc).
I don't know of any Haskell bindings offhand, but
Then can i change it to :
case timeout of
Just str - do
[(t, _)] - reads str
addTimeout t (hPutStrLn stderr *** TIMEOUT _exit 1)
return ()
_ - return ()
Sincerely!
Brandon S. Allbery KF8NH wrote:
On Feb 27, 2010, at 04:07 , zaxis wrote:
Am Sonntag 28 Februar 2010 02:08:18 schrieb zaxis:
Then can i change it to :
case timeout of
Just str - do
[(t, _)] - reads str
addTimeout t (hPutStrLn stderr *** TIMEOUT _exit 1)
return ()
_ - return ()
Sincerely!
No. The | [(t,_)] -
On Sat, Feb 27, 2010 at 05:08:18PM -0800, zaxis wrote:
Then can i change it to :
case timeout of
Just str - do
[(t, _)] - reads str
addTimeout t (hPutStrLn stderr *** TIMEOUT _exit 1)
return ()
_ - return ()
No, that's different. You
I've sketched out a Haskell interface to a C++ toolkit that uses threads.
It's the Haiku (BeOS) platform API (BeOS is an obscure OS from the '90s,
Haiku is a pretty faithful recent open source re-implementation.)
The API is fairly obvious and I imagine much like others that support
windowed
thanks!
case timeout of
Just str -
case reads str of
[(t,_)] - addtimeout (hPutStrLn stderr *** TIMEOUT _exit 1)
_ - return ()
_ - return ()
is VERY clear!
Daniel Fischer-4 wrote:
Am Sonntag 28 Februar 2010 02:08:18 schrieb zaxis:
Then can i change it to :
case
Thanks,
I'll follow your suggestion and get back with any doubts that I might have.
Regards,
Kashyap
On Sat, Feb 27, 2010 at 1:37 AM, Pierre-Evariste Dagand
pedag...@gmail.comwrote:
Hi Kashyap,
What would be your recommendation on how to get a grasp of FoF
Well, you can read the PLOS paper
I have seen some proposals around here for SoC projects and other
things to try to improve the latency of GHC's garbage collector. I'm
currently developing a game in Haskell, and even 100ms pauses are
unacceptable for a real-time game. I'm calling out to people who have
seen or made such
36 matches
Mail list logo