Why not use uu-parsinglib, which will tell you what is wrong and nevertheless
will continue parsing?
Currently Jacco Krijnen is working on an extensible version of Pandoc, based on
the AspectAG and the Murder packages, so you can define your own plugins for
syntax and semantics.
Doaitse
Maybe this is something you do not even want to use a parser combinator library
for. The package
http://hackage.haskell.org/packages/archive/list-grouping/0.1.1/doc/html/Data-List-Grouping.html
contains a function breakBefore, so you can write
main = do inp - readFile ...
let
= {Arthur I. Baars and
S. Doaitse Swierstra and
Marcos Viera},
title = {Typed Transformations of Typed Grammars: The Left Corner
Transform},
journal = {Electr. Notes Theor. Comput. Sci.},
volume= {253},
number= {7},
year = {2010
On Aug 21, 2012, at 13:46 , Heinrich Apfelmus apfel...@quantentunnel.de wrote:
Doaitse Swierstra wrote:
Heinrich Apfelmus wrote:
I have a small question: Last I remember, you've mainly been using
your UUAGC preprocessor to write attribute grammars in Haskell,
especially for UHC. Now that
Again we will teach an Applied Functional Programming Summer in Haskell
school this year at Utrecht University. In the previous two occasions students
were all very happy with the school and we plan to repeat this success this
year.
The intended audience are prospective master students who
Eelco Dolstra has written a thesis about something like that. Unfortunataly not
in Haskell.
See http://nixos.org/
Doaitse
On 17 mrt 2011, at 21:00, Serge Le Huitouze wrote:
Hi Haskellers!
I think I remember reading a blog post or web page describing a
EDSL to describe tasks and their
Although this may need a bit of work you might take the parsing code form the
Utrecht Haskell Compiler (http://www.cs.uu.nl/wiki/bin/view/UHC/Download),
which uses the uulib parser combinators. They are top-down parsers, and thus
can be used to parse any prefix given a specific parser, i.e.
Version 2.7.0 was uploaded to hackage.
From the CHANGELOG:
Version 2.7.0
Improvement: change of error correction at end of amb (which deals with
ambiguous parsers) combinator; available lookahead is better taken into account
Relatively large change:
• Change to Data.ListLike inputs,
I have small program UULib which i use for checking some timing information.
When I compile with ghc 7 and profiling information I get the timings which are
more or less what I expect.
If I however recompile without profiling tome consumed goes up by a factor of
20!
1) Am I misinterpreting the
I have small program UULib which i use for checking some timing information.
When I compile with ghc 7 and profiling information I get the timings which are
more or less what I expect.
If I however recompile without profiling tome consumed goes up by a factor of
20!
1) Am I misinterpreting the
An old problem popped up in the uu-parsinglib. When combining two parsers with
|, it is checked to see which alternative accepts the shortest input; this
is done in order to prevent infinite insertions, which may occur as a result of
choosing a recursive alternative when inserting of some
On 29 sep 2010, at 00:58, o...@cs.otago.ac.nz wrote:
Avoiding repeated additions:
movingAverage :: Int - [Float] - [Float]
movingAverage n l = runSums (sum . take n $l) l (drop n l)
where n' = fromIntegral n
runSums sum (h:hs) (t:ts) = sum / n' : runSums (sum-h+t) hs ts
Avoiding repeated additions:
movingAverage :: Int - [Float] - [Float]
movingAverage n l = runSums (sum . take n $l) l (drop n l)
where n' = fromIntegral n
runSums sum (h:hs) (t:ts) = sum / n' : runSums (sum-h+t) hs ts
runSums _ _ [] = []
Doaitse
On 28
On 16 sep 2010, at 05:42, Jared Jennings wrote:
On Fri, Sep 10, 2010 at 2:00 PM, S. Doaitse Swierstra
doai...@swierstra.net wrote:
I show how this can be done using uu-parsinglib. Note that we have sevral
parsers, each having its own type:
Thanks for such a complete example, Doaitse
I show how this can be done using uu-parsinglib. Note that we have sevral
parsers, each having its own type:
module Transactions where
import Text.ParserCombinators.UU
import Text.ParserCombinators.UU.Examples
import Data.Char
pTagged tag (pAttr, pPayload) = pToken ( ++ tag ++ ) * pAttr *
I am in my yearly fightto get a working combination of operating system (Snow
Leopard), compiler version (6.12) , wxWidgets and wxHaskell on my Mac .
After deleting most of my stuff, starting afresh, hours of building using
macports etc. I finally get the message:
loeki:Opgave doaitse$ ghc
I have uploaded a new version of the uu-parsinglib. It contains, besides the
extension of the abstract interpretation part and the fixing of some very
subtle corner cases in that part, some nice new functionality:
The call of the parser:
-- run ((,,,) `pMerge` (pSome pa || pMany pb || pOne pc
I have added the permutation parsers from uulib to uu-parsinglib:
http://hackage.haskell.org/packages/archive/uu-parsinglib/2.5.1.1/doc/html/Text-ParserCombinators-UU-Perms.html,
where you find reference to the paper
Doaitse
On 22 jun 2010, at 09:24, Stephen Tetley wrote:
Hello
Maybe
On 29 jul 2010, at 05:04, David Place wrote:
Hi, Doaitse.
I am making good progress transcribing my parser to use your library. I
think some ways that I have grown accustomed to working with Parsec will not
work, though. Now, I am getting the run time error:
Result: ***
On 27 jul 2010, at 09:30, Eugene Kirpichov wrote:
Perhaps this might mean that we can get incremental and parallel
regexp matching by associating each character with a linear operator
This is exactly what is happening in the uu-parsinglib.
Doaitse
(matrix) over this or related semiring,
references.
Doaitse
2010/7/28 S. Doaitse Swierstra doai...@swierstra.net:
On 27 jul 2010, at 09:30, Eugene Kirpichov wrote:
Perhaps this might mean that we can get incremental and parallel
regexp matching by associating each character with a linear operator
This is exactly what is happening
On 26 jul 2010, at 03:51, Jason Dagit wrote:
Hello,
I find that parser correctness is often hard to verify. Therefore, I'm
interested in techniques that others have used successfully, especially with
Haskell.
It seems to me that you are not so much trying to verify parsers, but more
I took a quick look at this file. To me it seems a mixture of a lexer and a
parser built on top of a home brewn parser library. I see function like
maybeWork which
(if I interpret correctly) test whether specific conditions hold for the input,
etc.
Indeed it would be nice to have a
How about:
*Main fromJValue (JBool True) :: Either JSONError Bool
Right True
*Main
Doaitse
On 26 jul 2010, at 15:16, Angel de Vicente wrote:
data JValue = JString String
| JNumber Double
| JBool Bool
| JNull
| JObject [(String, JValue)]
The simplest way to make a recogniser out of a RE is to use one of the
available parsing libraries:
module RE where
import Text.ParserCombinators.UU
import Text.ParserCombinators.UU.Examples
data RE = Epsilon | Leaf Char | Selection RE RE | Sequence RE RE | Kleene RE |
Optional RE | End
I am trying to document my parser library. In order to do so I should like to
include some example output in my haddock documentation. I fail to see however
how to get a block of output into the haddock part.
E.g.
-- | We can now run the parser @`pa`@ on input \a\, which succeeds:
-- @
I am trying to document my parser library. In order to do so I should like to
include some example output in my haddock documentation. I fail to see however
how to get a block of output into the haddock part.
E.g.
-- | We can now run the parser @`pa`@ on input \a\, which succeeds:
-- @
Despite the interesting discussing which has followed this question I think
that in orde to approach this specific problem the use of a specific
compiler-writers toolset such as the uuagc
(http://hackage.haskell.org/package/uuagc-0.9.29)) system is to be preferred;
it provides aneffiicent and
wrote:
On Wednesday 21 July 2010 16:09:37, S. Doaitse Swierstra wrote:
I am trying to document my parser library. In order to do so I should
like to include some example output in my haddock documentation. I fail
to see however how to get a block of output into the haddock part.
E.g.
-- | We
I have uploaded a new version of the package uu-parsinglib, te collection of
online, error-correcting parser combinators, with both an applicative and a
monadic interface.
* The new version behaves better when more than three corrective steps have to
be taken at a specific position. In order
If you use the uu-parsing libraries you will get a breadth-first search,
instead of a non-backtrcaking depth-first search of Parsec; furthermore you do
not suffer from space leaks and get your results online. In addition you get
error correction, with high-quality error messages.
The
If you want to use the easier long-standing libraries from Utrecht, we can provide you with a parser for full Haskell, which you can find in the Utrecht Haskell Compiler (UHC) distribution.In 2002 Alexey Rodriguez produced a C fron-end, using the UUlibs combinators. I am attaching the file with
On 27 apr 2010, at 22:12, Jason Dusek wrote:
So UU parsers can construct input?
The perform an editing action on the input so it becomes a sentence of the
language recognised.
The presence of an
empty list in the 2nd slot of the tuple is the only
indicator of errors?
The parser wants
How about:
import Text.ParserCombinators.UU.Parsing
import Text.ParserCombinators.UU.Examples
pDate :: Pars (Int,Int,Int)
pDate = (,,) $ pNatural * pDot * pNatural * pDot * pNatural
where pDot = pSym '.'
and then:
*Main test pDate 3.4.5
Loading package syb-0.1.0.2 ... linking ...
On the page:
http://hackage.haskell.org/platform/
I am told that the platform includes ghc-6.10.4, but if I click there on the
Haskell:batteries included link to get to the page:
http://hackage.haskell.org/platform/contents.html
its states there that I get 6.12.1?
Doaitse
It seems that I am being served old pages by my web browser from the cache on
my machine. By reloading the platform page, I suddenly am asked what system I
do have, from weher I am referred to the 6.12 version of the platform,
Doaitse
On 22 mrt 2010, at 14:25, Don Stewart wrote:
doaitse:
On 9 mrt 2010, at 20:04, boblettoj wrote:
Hi, i am getting an error when trying to compile this part of my program, its
my first time using haskell and as lovely as it is it didn't give me very
much to go on in the error message!
codescore :: String - String - String
score [s] [] =
How about using one of the existing libraries, in this case uu-
parsinglib:
module Parse where
import Text.ParserCombinators.UU.Parsing
import Text.ParserCombinators.UU.Examples
data Verb = Go | Get | Jump | Climb | Give deriving (Show)
pCommand :: Pars String
pCommand = foldr (|) pFail (map
How about using one of the existing libraries, in this case uu-
parsinglib:
module Parse where
import Text.ParserCombinators.UU.Parsing
import Text.ParserCombinators.UU.Examples
data Verb = Go | Get | Jump | Climb | Give deriving (Show)
pCommand :: Pars String
pCommand = foldr (|) pFail (map
When cycling home I realised it could even be shorter:
module Parse where
import Text.ParserCombinators.UU.Parsing
import Text.ParserCombinators.UU.Examples
data Verb = Go | Get | Jump | Climb | Give deriving (Show)
pCommand :: Pars Verb
pCommand = foldr (\ c r - c $ pToken (show c) | r)
On 12 jan 2010, at 00:09, Günther Schmidt wrote:
Hi John,
thanks for responding. As I said I've been using Parsec quite a lot,
but wonder if there is a different approach possible/feasible to
parsing. Parsec (2x) isn't an online parser, ie, it doesn't
produce a result before the whole
How about:
http://hackage.haskell.org/package/orchid
a simple, but nice wiki produced by one of our students Sebastiaan
Visser,
Doaitse Swierstra
On 18 nov 2009, at 18:14, Günther Schmidt wrote:
Hi,
I'm finally about to organize myself, somewhat.
And am going to use a wiki for it.
pToken [] = pSucceed []
pToken (x:xs) = (:) $ pSym x * pToken xs
pKeyword_Float = pToken Float
etc
Doaitse
PS: this function has been defined in the module
Text.ParserCombinators.UU.Derived
On 28 okt 2009, at 17:39, Ozgur wrote:
Hi everybody,
I am using the uu-parsinglib to parse
On 22 okt 2009, at 15:56, Robert Atkey wrote:
Previously parsed input /can/ determine what the parser will accept
in
the future (as pointed out by Peter Ljunglöf in his licentiate
thesis).
Consider the following grammar for the context-sensitive language
{aⁿbⁿcⁿ| n ∈ ℕ}:
Yes,
Ok,
I think this is a weird problem, but let us start. You want to parse a
sequence of operands separated by an operator (we assume the ops are
left associative):
import Text.ParserCombinators.UU.Parsing
pWeird = pChainl pOperator pOperand
An operand is apparently a non-empty list of
really quite gratifying what a small amount
of haskell code suffices to make a useful and flexible program.
best regards,
Uwe
On 10/15/09, S. Doaitse Swierstra doai...@swierstra.net wrote:
On 15 okt 2009, at 16:58, Uwe Hollerbach wrote:
Hi, all, thanks for the further inputs, all good stuff
I am happy to announce that the rworked lecture notes for the 6th
Advance Functional programming summer school have become available.
For further information about the lecture notes:
On 15 okt 2009, at 16:58, Uwe Hollerbach wrote:
Hi, all, thanks for the further inputs, all good stuff to think
about... although it's going to be a little while before I can
appreciate the inner beauty of Doaitse's version! :-)
The nice thing is that you do not have to understand the inner
I could not resist this. The code
import Text.ParserCombinators.UU.Parsing
pCommand [] = pure []
pCommand xxs@(x:xs) = ((:) $ pSym x * pCommand xs) `opt` xxs
pCommands = amb . foldr (|) pFail . map pCommand $ [banana,
chocolate, frito, fromage]
t :: String - ([String], [Error Char Char
This problem of dynamically transforming grammars and bulding parsers
out of it is addressed in:
@inproceedings{1411296,
author = {Viera, Marcos and Swierstra, S. Doaitse and Lempsink,
Eelco},
title = {Haskell, do you read me?: constructing and composing
efficient top-down parsers at
On 2 okt 2009, at 20:37, Jake McArthur wrote:
Günther Schmidt wrote:
And that I find to be the really tricky part, how do I *design* a
DSL?
I once wrote a tutorial on this subject in which I explain that
designing a DSL is not so much different from an ordinary programming
language;
I am trying to run happstack on my Mac, but unfortunately I am getting
error messages as described in:
http://code.google.com/p/happstack/issues/detail?id=88
The cure seems to be to downgrade to network-2.2.0.1, but
unfortunately my installed cabal depends on network-2.2.1.4.
I tried to
Subject: Ph.D position, Utrecht University, the Netherlands
===
Vacancy PhD student on Realizing Optimal Sharing in the Functional
Language Implementations
Utrecht University,
The Netherlands.
===
On 28 aug 2009, at 08:11, Jason Dusek wrote:
2009/08/27 Bulat Ziganshin bulat.zigans...@gmail.com:
...stop reusing Prelude operators, in particular, replace -
with $?
I have to say, the `$ do` construct is an eyesore and `- do` is a
lot easier on the eyes.
Would it introduce ambiguity in
an obvious way to use both libraries in one parsing module
simulatiously. However, these are a very good news indeed, thank you
2009/8/9 S. Doaitse Swierstra doai...@swierstra.net
The uu-parsinglib:
http://hackage.haskell.org/packages/archive/uu-parsinglib/2.2.0/doc/html/Text-ParserCombinators-UU
The uu-parsinglib:
http://hackage.haskell.org/packages/archive/uu-parsinglib/2.2.0/doc/html/Text-ParserCombinators-UU-Core.html
contains a combinator to achieve just this:
-- parsing two alternatives and returning both rsults
pAscii = pSym ('\000', '\254')
pIntList = pParens
The Dutch government has been trying to get something like this for
years; parliament is asking every new minister why the promised heaven
has not yet arrived, only to hear that more consultants are needed. I
have been to hearings of our parliament and I can tell you such events
are
And rename empty to fail? You managed to confuse me since I always
use pSucceed to recognise the empty string.
Doaitse
On 1 jun 2009, at 01:21, Ross Paterson wrote:
On Sun, May 31, 2009 at 09:40:38PM +0200, S. Doaitse Swierstra wrote:
A new version of the uu-parsinglib has been uploaded
A new version of the uu-parsinglib has been uploaded to hackage. It is
now based on Control.Applicative where possible.
Be warned that functions like some and many will be redefined in the
future.
Doaitse Swierstra
___
Haskell-Cafe mailing list
Dear Gunther,
I am providing my solution, on which one can of course specialise in
making sure that a valid date is parsed, which would be a bit more
cumbersome; how should e.g. error correction be done. I prefer to test
afterwards in such situations.
Best,
Doaitse
module Guenther
Lazy parsing has been the default for the last ten years in uulib, and
is now available in the simple uu-parsinglib (http://hackage.haskell.org/cgi-bin/hackage-scripts/package/uu-parsinglib
). The whole design of the latter in described in a technical report
to which references are given on
In the uu-parsinglib we actually have two versions of parsers: lazy
ones and strict ones, which have different types. So by giving a type
annotation you can select the one you want. Notice that in the left-
hand side of a monadic construct it does not make sense to use a lazy
parser, since
Dear Rouan,
on
http://www.cs.uu.nl/wiki/HUT/WebHome
you will find a collection of tools which may help you to construct a
compiler. As an example you will find a Tiger compiler constructed
with the uulib tools and the uuagc attribute grammar system. Tiger is
the language used in the book
As Lennart said, the complete offside rule as found in Haskell is
almost impossible to get right. This is mainly due to the way in which
it is formulated: in terms of error correction. This makes it very
difficult to build a parser for such rules which have error correction
built into
Unfortunately I think 4 man years is definitely below the minimum of
the guesses I would get if I would ask the people in my group ;-}
Doaitse
On 23 apr 2009, at 16:13, John A. De Goes wrote:
Let's turn this around. You invest 4 months of your life coming out
with your own experimental
Maybe it has gone unnoticed, but the main reason we made the compiler
available, was to make it possible for others to experiment with its
type extensions, its Grin based back-end and to show the advantages
(and disadvantages?) of generating large part of the compiler from an
attribute
On 17 jan 2009, at 22:22, Derek Elkins wrote:
On Thu, 2009-01-15 at 13:40 +0100, Apfelmus, Heinrich wrote:
Eugene Kirpichov wrote:
Well, your program is not equivalent to the C++ version, since it
doesn't bail on incorrect input.
Oops. That's because my assertion
show . read = id
is
We are pleased to announce the availability of the package TTTAS,
which contains the code associated with our paper at the coming TLDI
workshop:
[EMAIL PROTECTED] BSV09,
author = {Arthur Baars and S. Doaitse Swierstra and Marcos Viera},
title = {Typed Transformations of Typed Abstract
We are pleased to announce the availability of the package
ChristmasTree, which contains the code associated with our paper at
the last Haskell symposium:
@inproceedings{1411296,
author = {Marcos Viera and S. Doaitse Swierstra and Eelco Lempsink},
title = {Haskell, do you read me
69 matches
Mail list logo