I suppose there are plenty of flavors for such functions, and they are
simple enough to write.
One I've been using a bit is this one:
loopM :: Monad m = a - (a - m (Maybe a)) - m ()
loopM start action = loop start
where
loop i =
do result - action i
case
Sorry for the double post before... must have hit send without
noticing :s (it would also help if I posted this to the mailing list
instead of just to myself!).
Anyway, I had a thought today: what about using a quadruply linked list?
i.e.:
data QLNode a = Null | QLNode a (Right a) (Up a) (Left
Hi..
I am currently working on a project where basically we do a lot of XML
validation and digestion. For example :
We recieve an XML document A, if the document passes schema validation, we
do some business level validations, then from A, we create XML digests B, C
and D.
Our code-base is
Not sure the proposal helps me with my other issues. The appealing
thing about hlists is that labels are first class which means obvious
ways of parsing URLEncoded Strings and obvious ways to render them in
XML. In particular HLists are actually a different type from
positional data
On Thu, 2007-03-22 at 14:04 +0530, Arun Suresh wrote:
I am currently working on a project where basically we do a lot of XML
validation and digestion. For example :
We recieve an XML document A, if the document passes schema
validation, we do some business level validations, then from A, we
Ivan Lazar Miljenovic wrote:
Anyway, I had a thought today: what about using a quadruply linked list?
i.e.:
data QLNode a = Null | QLNode a (Right a) (Up a) (Left a)
(Bottom a)
where Right, Up, Left and Bottom are just type synonyms of QLNode.
You
Hi Arun,
Your problem description seems a little vague - which is
understandable, considering how embedded in your business model it is.
As for general recommendations, I'm no guru, but I would suggest
looking at the existing XML libraries in Haskell [1], and if that's
not powerful enough, check
I am learning Haskell working through Simon Thompson book Haskell The Craft
of Functional Programming (second edition). Solving problems in the book
with more or less success I arrived almost to the end of the book at the
section 17.5 Case study: parsing expressions.
Most probably the question I
On Thu, Mar 22, 2007 at 06:13:00PM +0300, Dmitri O.Kondratiev wrote:
F :: a - b - c
Is the same as:
F :: a - (b - c)
Correcting the typo (use f, not F), these mean the same thing.
And means either:
-a function 'f' of one argument of type 'a' that returns a function of
type (b -
On Thu, Mar 22, 2007 at 06:13:00PM +0300, Dmitri O.Kondratiev wrote:
succeed :: b - Parse a b
*Before looking at 'succeed' function definition* one may think that
'succeed' is a function of *one* argument of type 'b' that returns object of
type 'Parse a b'.
Yet, function definition
Dmitri writes:
Now, in the 17.5 section of a book one may see the following declarations:
succeed :: b - Parse a b
*Before looking at 'succeed' function definition* one may think that
'succeed' is a function
of *one* argument of type 'b' that returns object of type 'Parse a b'.
Yet,
Now, in the 17.5 section of a book one may see the following declarations:
succeed :: b - Parse a b
*Before looking at 'succeed' function definition* one may think that
'succeed' is a function of *one* argument of type 'b' that returns object
of
type 'Parse a b'.
Antti-Juhani Kaijanaho
Hello folks
A section on GADTs in the GHC user's guide gives a simple example:
data Term a where
Lit:: Int - Term Int
Succ :: Term Int - Term Int
IsZero :: Term Int - Term Bool
eval :: Term a - a
eval (Lit i) = i
eval (Succ t) = 1 + eval t
eval (IsZero t) =
Try the HEAD. GADTs + type classes are broken in 6.6., and will stay that way
I'm afraid.
Simon
| -Original Message-
| From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Daniil
| Elovkov
| Sent: 22 March 2007 17:12
| To: haskell-cafe@haskell.org
| Subject: [Haskell-cafe]
hi, i have been trying to learn haskell and i would like to translate the
following object-oriented pseudo-code into working haskell code but i'm
stumped on how to write the next function in the haskell code. any help is
appreciated.
class Random
...
end
ran = Random.new(300)
ran.next() - this
Hello,
I'm making an assembly language DSEL in Haskell (just for fun) very
similar to the one from Russel O' Conner in [1]
I'm trying to specify a 'mov' instruction. A 'mov' instruction has two
operands: a destination and a source. There are various constraints on
the operands. They have to be
david karapetyan wrote:
hi, i have been trying to learn haskell and i would like to translate
the following object-oriented pseudo-code into working haskell code
but i'm stumped on how to write the next function in the haskell code.
any help is appreciated.
class Random
...
end
ran =
Bas van Dijk wrote:
I would also like to get the formatting constraints working. However
the solution in the code below gives a Duplicate instance
declarations error. If I -fallow-overlapping-instances than the type
checker goes into an infinite loop.
I would like to know why this is
Ok, thank you very much.
Interesting thing though, it's the same on 6.4.1.
Wasn't this brokenness introduced in 6.6, but rather has lingered in
ghc for a while, or since the introduction of GADTs, at all?
2007/3/22, Simon Peyton-Jones [EMAIL PROTECTED]:
Try the HEAD. GADTs + type classes are
When I load my program, GHC spits these messages at me, but doesn't
fail Any idea what might be causing this or how to figure that out?
Var/Type length mismatch:
[]
[a{tv aGIf} [tau]]
...
Var/Type length mismatch:
[]
[a{tv aGN8} [tv]]
...
I found the responsible code in GHC's darcs,
On 3/22/07, Nicolas Frisby [EMAIL PROTECTED] wrote:
When I load my program, GHC spits these messages at me, but doesn't
fail Any idea what might be causing this or how to figure that out?
Var/Type length mismatch:
[]
[a{tv aGIf} [tau]]
...
Var/Type length mismatch:
[]
[a{tv
Don't spend too much time on the various libraries though. I tried
some simple things with Haskell and XML, but I found it really hard
to actually parse a simple document. You really don't want to write
your own parser.
The only tool that worked for me was HXT, which is based on arrows.
Hey Aron,
I think you intended to CC Haskell Café as well. HaXml has support
for DtdToHaskell, but HXT supports validating with a Relax NG
validator. I guess the best way to figure it out is thoroughly read
the documentation.
-chris
On Mar 22, 2007, at 10:40 PM, Arun Suresh wrote:
[EMAIL PROTECTED]Hi,
I wanted to try out hat debugger. I tried to install it according to
instructions.
I downloaded the source tgz and did following sequence of operations
tar -xvzf hat-2.05.tar.gz
cd hat-2.05
./configure
make
it gives me following error!
MkProg: hmake: the compiler 'ghc'
24 matches
Mail list logo