Maybe you've invented the ApoPrelude?
If I were doing it I'd probably code them in terms of an apomorphism -
unfoldr with flush. Unlike regular unfoldr which discards the final
state, an apomorphism uses the final state to produce the tail of the
output list. See Jeremy Gibbons paper Streaming
Hello,
I'm working on a library which aims to be a generic interface for 2D
rendering. To do that, one of my goals is to enable each implementation of
this interface to run in its own monad (most of the time an overlay to IO),
thus giving me the following class
class (Monad (IM i x)) = Impl i x
On 2 March 2011 09:11, Yves Parès limestr...@gmail.com wrote:
class (forall x. Monad (IM i x)) = Impl i where
data IM i :: * - * - *
But GHC forbids me to do so.
The way I usually work around this is by doing something like the
following pattern:
{{{
class Monad1 m where
return1 :: a
bri...@aracnet.com writes:
I worked out a small hdf5 binding using cabal and bindings-DSL and
sqlite3 as my example.
Hi,
I just wanted to add that I also started an HDF5 binding recently (using
hsc2hs only). It does more than enough for me ATM, so I don't develop
it actively, but if you want
There are quite a few exception handling mechanisms provided by Haskell,
as can be seen from this post:
http://www.randomhacks.net/articles/2007/03/10/haskell-8-ways-to-report-errors
I would like to know what is the preferred Haskell mechanism for handling
exceptions in
the IO monad? I am not
Thank you !
Is what I'm trying to do a common technique to type-ensure contexts or are
there simpler methods?
2011/3/2 Max Bolingbroke batterseapo...@hotmail.com
On 2 March 2011 09:11, Yves Parès limestr...@gmail.com wrote:
class (forall x. Monad (IM i x)) = Impl i where
data IM i ::
On Wed, 2 Mar 2011, Rouan van Dalen wrote:
I would like to know what is the preferred Haskell mechanism for
handling exceptions in the IO monad? I am not concerned with mechanisms
such as Maybe / Either, but would like to know about exception
mechanisms inside the IO monad.
The 2 I know
What an interesting coincidence, that makes at least three of us. Apparently
it's an idea whose time has come.
Mine is also an incomplete low-level binding but is currently under semi-active
development and I aim to make it cover the entire hdf5.h interface.
If anyone is interested in it I've
Thank you all for the responses. Here's an example:
As I alrerady said, I tried to parse the MMIXAL assembly language.
Each instruction has up to three operands, looking like this:
@+4 (Jump for bytes forward)
foo (the string foo
'0'(1+2)
etc. A string literal may contain anything
Hi,
Robert Clausecker wrote:
Each instruction has up to three operands, looking like this:
@+4 (Jump for bytes forward)
foo (the string foo
'0'(1+2)
etc. A string literal may contain anything but a newline, (there are
no escape codes or similar). But when I add a check for a
On Wed, 2 Mar 2011 14:14:02 +0100, you wrote:
Thank you all for the responses. Here's an example:
As I alrerady said, I tried to parse the MMIXAL assembly language.
Each instruction has up to three operands, looking like this:
@+4 (Jump for bytes forward)
foo (the string foo
Thanks to everyone for the nice solutions to this puzzle,
here and on reddit:
http://www.reddit.com/r/haskell/comments/fu6el/a_practical_haskell_puzzle/
There were two basic approaches. One was to use GADTs and
higher-rank types to reduce the amount of type trickery needed.
One nice example is
Apologies if this has been answered already (I've got a bit lost with
this thread), but the *try* here seems to be giving you precisely the
behaviour you don't want.
*try* means backtrack on failure, and try the next parser. So if you
want ill formed strings to throw an error if they aren't
Hi all,
I am working on ways to implement local search meta-heuristics in Haskell.
I need various test problems to experiment on, and this has resulted in me
building various file parsers and data structures for these.
Currently I have versions for SAT, TSP and a couple of more private file
Actually this is stranger than I thought - from testing it seems like
Attoparsec's (|) is different to Parsec's. From what I'm seeing
Attoparsec appears to do a full back track for (|) regardless of
whether the string lexer is wrapped in try, whereas Parsec needs try
to backtrack.
On 2 March 2011
Actually, It's not | that's different, it's the string combinator.
In Parsec, string matches each character one at a time. If the match
fails, any partial input it matched is consumed. In attoparsec,
string matches either the entire thing or not, as a single step. If
it fails to match, no input
Hi.
Some time ago I forgot to forward this message to thie ur versus Haskell
http://www.haskell.org/pipermail/haskell-cafe/2011-January/088060.htmldiscussion,
(as usual)
---
The most impressive feature (of ur) is the compile time checking of
conformance between the form and the form results.
Excerpts from Alberto G. Corona's message of Wed Mar 02 20:53:28 + 2011:
Some time ago I forgot to forward this message to thie ur versus Haskell
http://www.haskell.org/pipermail/haskell-cafe/2011-January/088060.htmldiscussion,
(as usual)
---
The most impressive feature (of ur) is the
WASH is full of wonderful ideas . packed in a not so wonderful syntax. It
is worth to evolve it.
WASH does force form safety in a similar way to Formlets
http://hackage.haskell.org/package/formlets: because the form and the
form read code are generated automatically by a class instance. So
Hi Richard,
On Thu, Mar 3, 2011 at 1:46 AM, Richard Senington sc06...@leeds.ac.ukwrote:
The file parsers are designed to process files coming out of the TSPLIB and
SATLIB
repositories. [...]
Since these are all related I was going to try to put them together into a
single
library and post
2011/3/2 Yves Parès limestr...@gmail.com:
Is what I'm trying to do a common technique to type-ensure contexts or are
there simpler methods?
I don't understand your problem well enough to be able to venture a
solid opinion on this. Sorry! What you have detailed so far doesn't
sound too complex,
Okay thanks I got the difference between both.
The 'exists' syntax seems very useful. Is it planned to be added to GHC in a
near future?
2011/2/28 Heinrich Apfelmus apfel...@quantentunnel.de
Yves Parès wrote:
takeC :: Int - Compoz a b - (exists c. Compoz a c)
dropC :: Int - Compoz a b -
The trick is to write the rank-2 type in the function that runs
the monad, and leave the typeclasses skolemized.
Here's an example:
-- | Typeclass for monads that write or read to a network. Useful
-- if you define operations that need to work for all such monads.
-- You're expected to put
From: Yitzchak Gale g...@sefer.org
To: haskell-cafe@haskell.org
Cc: Heinrich Apfelmus apfel...@quantentunnel.de; Lennart Augustsson
lennart.augusts...@gmail.com
Sent: Wed, March 2, 2011 9:45:15 AM
Subject: Re: [Haskell-cafe] A practical Haskell puzzle
Thanks to everyone for the nice
Welcome to issue 171 of the HWN, a newsletter covering developments
in the [1]Haskell community. This release covers the week of
February 20 - 26, 2011 .
Announcements
Eric Kow [2]announced that the Darcs project is staring to organize the
next hacking sprint, which will be most
Hello,
I'm learning Haskell from the extremely well written (and well
illustrated as well!) tutorial - http://learnyouahaskell.com/chapters.
I have couple of questions from my readings so far.
In typeclasses - 101
(http://learnyouahaskell.com/types-and-typeclasses#typeclasses-101),
there is a
On Thu, 2011-03-03 at 11:39 +0530, Karthick Gururaj wrote:
What is the () type? Does it refer to a tuple? How can tuple be
ordered, let alone be enum'd? I tried:
The () type is pronounced unit. It is a type with only 1 value, also
called () and pronounced unit. Since it only has one possible
Hi all,
I'm very new to Haskell, having started earlier this week. This is my
second attempt after two years :) Currently, I can do simple list
processing/recursion/functions. I'm using GHC on Ubuntu.
I decided to use puzzles as a way to explore list filtering. For
example, while normal solution
Hi Haskellers,
whats your Haskell IDE of choise? Currently I use leksah. Is the EclipseFP
Plugin for Eclipse a real alternative?
Thanks
Klaus
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
On Thu, Mar 3, 2011 at 11:48 AM, Chris Smith cdsm...@gmail.com wrote:
On Thu, 2011-03-03 at 11:39 +0530, Karthick Gururaj wrote:
What is the () type? Does it refer to a tuple? How can tuple be
ordered, let alone be enum'd? I tried:
The () type is pronounced unit. It is a type with only 1
A year and something ago I used Leksah and I was reasonably satisfied
with what it had to offer at that time. If I'm understanding
correctly, it has been much improved since.
However, now I actually use vim - but that's because I'm scared of
trying to install Leksah on Windows (maybe it isn't
On Thu, Mar 3, 2011 at 8:05 AM, Hauschild, Klaus (EXT)
klaus.hauschild@siemens.com wrote:
Hi Haskellers,
whats your Haskell IDE of choise? Currently I use leksah. Is the EclipseFP
Plugin for Eclipse a real alternative?
Thanks
Klaus
Hello, I'm one of the maintainers of EclipseFP. It
On 3 March 2011 17:59, Karthick Gururaj karthick.guru...@gmail.com wrote:
On Thu, Mar 3, 2011 at 11:48 AM, Chris Smith cdsm...@gmail.com wrote:
On Thu, 2011-03-03 at 11:39 +0530, Karthick Gururaj wrote:
What is the () type? Does it refer to a tuple? How can tuple be
ordered, let alone be
On 2 Mar 2011, at 22:38, Sebastian Fischer wrote:
You could place the parsers under
Text.TSPLIB
Text.SATLIB
Text
Some other suggestions might be
Codec.TSP
Codec.SAT
or
FileFormat.TSP
FileFormat.SAT
Regards,
Malcolm
On Thu, Mar 03, 2011 at 12:29:44PM +0530, Karthick Gururaj wrote:
Thanks - is this the same unit that accompanies IO in IO () ? In
any case, my question is answered since it is not a tuple.
It can be viewed as the trivial 0-tuple.
--
Antti-Juhani Kaijanaho, Jyväskylä, Finland
35 matches
Mail list logo