Re: Happy / Alex description for Haskell2010

2018-10-25 Thread Doaitse Swierstra
I do not know why you do need a Haskell parser, but the Utrecht Haskell Compiler contains a combinator based Haskell parser (using the uulib package, supporting the offside rule) which might serve your needs. It can easily be adapted if needed. Doaitse Swierstra > Op 25 okt. 2018, om 20

FYI

2018-07-12 Thread Doaitse Swierstra
- Job > >> On Jul 11, 2018, at 4:44 PM, Doaitse Swierstra wrote: >> >> Dear Job, >> >> I made lenses compatible with the new version of GHC. can you put it on >> hackage if you approve and update the github too. It sti

I discovered that the uu-options package does not compile due to a dependency on lenses, which does not compile with GHC 8.4

2018-07-11 Thread Doaitse Swierstra
In case you want to try here is an updated lenses package. Best, Doaitse PS: I contacted Job (the author) in order to get things updated lenses.cabal Description: Binary data Setup.hs Description: Binary data LICENSE Description: Binary data <>

Re: [Haskell] 6 Assistant professor positions in Utrecht

2018-01-04 Thread Doaitse Swierstra
Ik had ook al aan Johan gemeld dat het woord talented suggereert dat er bij jullie ook non-talented personen werken. Hij zou het aan laten passen. Doaitse Op 4 jan. 2018 09:13 schreef "Swierstra, W.S. (Wouter)" : > We are currently advertising vacancies for > > > 6

Re: Shall the Haskell Report remain in LaTeX?

2017-10-31 Thread Doaitse Swierstra
The good thing about laTeX is that out of all the candidates it is the most likely one to still work 40 years from now, Doaitse > Op 9 sep. 2017, om 15:40 heeft Herbert Valerio Riedel > het volgende geschreven: > > Hello *, > > On 2017-09-08 at 00:46:52 +0200,

status of rebindable syntax for arrows

2014-10-14 Thread S. Doaitse Swierstra
The GHC manual already for quite a number of version states: • Arrow notation (see Section 7.17, “Arrow notation ”) uses whatever arr, (), first, app, (|||) and loop functions are in scope. But unlike the other constructs, the types of these functions must match the Prelude

question about GADT's and error messages

2014-05-13 Thread S. Doaitse Swierstra
Given the following code: {-# LANGUAGE GADTs #-} data Any a where AInt :: Int - Any Int -- demo 1 does not compile {- demo1 a = do case a of (AInt i) - print i Couldn't match expected type ‘t’ with actual type ‘IO ()’ ‘t’ is untouchable inside the constraints (t1 ~ Int)

Re: [Haskell-cafe] Haddock GSOC project progress

2013-08-05 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] simple parsec question

2013-03-05 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] Parser left recursion

2013-02-21 Thread S. Doaitse Swierstra
= {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

[Haskell-cafe] question about: --hyperlink-source

2013-02-21 Thread Doaitse Swierstra
I ran into the problem that for the packages which I install using cabal install The generated html does not contain links to the sources. This issue was raised before in: http://stackoverflow.com/questions/1587635/haddock-for-cabal-installed-modules I have been looking into the documentation

Re: GHC 7.8 release?

2013-02-10 Thread Doaitse Swierstra
Although it will definitely solve all problems, it would help if hackage would automatically send out mails to maintainers of packages which do not compile with specific ghc versions. I have ran a couple of time into the situation where new GHC releases did nor compile my packages anymore, and

Re: Bang patterns

2013-02-08 Thread Doaitse Swierstra
I prefer them to be part of the context-free syntax, since this enables a future extension in which an arbitary expression can be placed between backticks. This would enable one to write things as: x `f i` y and expr1 `expr2` expr3 is to be interpreted as (expr2) (expr1) (expr3),

[Haskell-cafe] Sol vingt simple problem in various languages and systems

2013-02-07 Thread Doaitse Swierstra
At https://gist.github.com/ckirkendall/2934374 you find solutions in many languages to a simple programming problem: the evaluation of an expression in an environment. I want to point your attention to the currently last three entries: - one using the UUAGC compiler to solve the problem

Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-02-02 Thread Doaitse Swierstra
On Jan 31, 2013, at 10:47 , Jan Stolarek jan.stola...@p.lodz.pl wrote: Thanks for replies guys. I indeed didn't notice that there are monads and applicatives used in this parser. My thought that monadic parsers are more verbose came from Hutton's paper where the code is definitely less

Re: [Haskell-cafe] list comprehansion performance has hug different

2013-01-30 Thread Doaitse Swierstra
From the conclusion that both programs compute the same result it can be concluded that the fact that you have made use of a list comprehension has forced you to make a choice which should not matter, i.e. the order in which to place the generators. This should be apparent from your code. My

Re: [Haskell-cafe] catamorphisms and attribute grammars

2013-01-27 Thread Doaitse Swierstra
nowadays to generate this code form uuagc input. http://www.cs.uu.nl/wiki/bin/view/Center/PhDs Doaitse Swierstra On Jan 26, 2013, at 23:03 , Petr P petr@gmail.com wrote: Dear Haskellers, I read some stuff about attribute grammars recently [1] and how UUAGC [2] can be used for code

[Haskell] Summer school on Applied Functional Programming at Utrecht University; deadline for registration May 15

2013-01-20 Thread Doaitse Swierstra
on questions asked http://www.cs.uu.nl/wiki/USCS/ -- on this page you can find the poster you can print and hang somewhere (why not your office door): Furthermore we ask for your cooperation to bring this announcement under the attention of potential participants. Best, Doaitse Swierstra

[Haskell-cafe] Summer school on Applied Functional Programming at Utrecht University; deadline for registration May 15

2013-01-20 Thread Doaitse Swierstra
on questions asked http://www.cs.uu.nl/wiki/USCS/ -- on this page you can find the poster you can print and hang somewhere (why not your office door): Furthermore we ask for your cooperation to bring this announcement under the attention of potential participants. Best, Doaitse Swierstra

Re: In opposition of Functor as super-class of Monad

2012-10-24 Thread S. Doaitse Swierstra
There are very good reasons for not following this road; indeed everything which is a Monad can also be made an instance of Applicative. But more often than not we want to have a more specific implementation. Because Applicative is less general, there is in general more that you can do with it.

Re: [Haskell] Compositional Compiler Construction, Oberon0 examples available

2012-08-21 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] [Haskell] Compositional Compiler Construction, Oberon0 examples available

2012-08-21 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] phantom types

2012-08-21 Thread Doaitse Swierstra
On Aug 19, 2012, at 5:29 , wren ng thornton w...@freegeek.org wrote: On 8/17/12 5:35 AM, TP wrote: Hi, I am currently reading documentation on Generalized Algebraic Data Types: http://en.wikibooks.org/wiki/Haskell/GADT I have a question concerning this page. Let us consider the

[Haskell] Compositional Compiler Construction, Oberon0 examples available

2012-08-20 Thread Doaitse Swierstra
On Aug 19, 2012, at 10:40 , Heinrich Apfelmus apfel...@quantentunnel.de wrote: Doaitse Swierstra wrote: Over the years we have been constructing a collection of Embedded Domain Specific Languages for describing compilers which are assembled from fragments which can be compiled individually

[Haskell-cafe] Compositional Compiler Construction, Oberon0 examples available

2012-08-20 Thread Doaitse Swierstra
On Aug 19, 2012, at 10:40 , Heinrich Apfelmus apfel...@quantentunnel.de wrote: Doaitse Swierstra wrote: Over the years we have been constructing a collection of Embedded Domain Specific Languages for describing compilers which are assembled from fragments which can be compiled individually

[Haskell] Compositional Compiler Construction, Oberon0 examples available

2012-08-19 Thread Doaitse Swierstra
On Aug 19, 2012, at 10:40 , Heinrich Apfelmus apfel...@quantentunnel.de wrote: Doaitse Swierstra wrote: Over the years we have been constructing a collection of Embedded Domain Specific Languages for describing compilers which are assembled from fragments which can be compiled individually

[Haskell-cafe] Compositional Compiler Construction, Oberon0 examples available

2012-08-19 Thread Doaitse Swierstra
On Aug 19, 2012, at 10:40 , Heinrich Apfelmus apfel...@quantentunnel.de wrote: Doaitse Swierstra wrote: Over the years we have been constructing a collection of Embedded Domain Specific Languages for describing compilers which are assembled from fragments which can be compiled individually

[Haskell] [Announce] Compositional Compiler Construction, Oberon0 examples available

2012-08-16 Thread Doaitse Swierstra
how we use our first class attribute grammars to implement the static semantics associated with the various tasks of the challenge. We hope you like it, and comments are welcome, Marcos Viera Doaitse Swierstra ___ Haskell mailing list Haskell

[Haskell-cafe] [Announce] Compositional Compiler Construction, Oberon0 examples available

2012-08-16 Thread Doaitse Swierstra
how we use our first class attribute grammars to implement the static semantics associated with the various tasks of the challenge. We hope you like it, and comments are welcome, Marcos Viera Doaitse Swierstra ___ Haskell-Cafe mailing list

[Haskell] Summer school on Applied Functional Programming at Utrecht University; deadline for registration May 15

2011-04-18 Thread S. Doaitse Swierstra
://www.utrechtsummerschool.nl/index.php?type=coursescode=H9 Furthermore we ask for your cooperation to bring this announcement under the attention of potential participants. Best, Doaitse Swierstra PS: apologies if you get this mail more than once ___ Haskell mailing

[Haskell-cafe] Summer school on Applied Functional Programming at Utrecht University; deadline for registration May 15

2011-04-18 Thread S. Doaitse Swierstra
://www.utrechtsummerschool.nl/index.php?type=coursescode=H9 Furthermore we ask for your cooperation to bring this announcement under the attention of potential participants. Best, Doaitse Swierstra PS: apologies if you get this mail more than once ___ Haskell-Cafe

Re: [Haskell-cafe] DSL for task dependencies

2011-04-07 Thread S. Doaitse Swierstra
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

Re: [Haskell] A opportunity to lern (parsing huge binary file)

2011-03-19 Thread S. Doaitse Swierstra
The uu-parsing library support every ata type that is an instance of Data.Listlike (http://hackage.haskell.org/packages/archive/ListLike/3.0.1/doc/html/Data-ListLike.html#t:ListLike) and thus input from Data.Bytestring.Lazy. A very small starting program can be found below. Note that here we

Re: [Haskell-cafe] Wanted: composoable parsers from haskell-src-exts

2011-03-18 Thread S. Doaitse Swierstra
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.

[Haskell-cafe] [ANN] new version of uu-parsinglib

2011-03-12 Thread S. Doaitse Swierstra
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,

[Haskell-cafe] GHC timings

2011-01-20 Thread S. Doaitse Swierstra
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

[Haskell-cafe] GHC timings

2011-01-20 Thread S. Doaitse Swierstra
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

[Haskell-cafe] ANNOUNCE: new version of uu-parsinglib:2.5.6

2010-12-21 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] Help to create a function to calculate a n element moving average ??

2010-09-29 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] Help to create a function to calculate a n element moving average ??

2010-09-28 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] types for parsing a tree

2010-09-17 Thread S. Doaitse Swierstra
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

Re: new keyword: infixlr?

2010-09-10 Thread S. Doaitse Swierstra
On 10 sep 2010, at 20:13, Ian Lynagh wrote: On Fri, Sep 10, 2010 at 07:51:10PM +0200, S. Doaitse Swierstra wrote: Currently Haskell has infix, infixl and infixr operators. I see a use for infixlr as well. This indicates that the implemtation may assume the operator to be associative

Re: [Haskell-cafe] types for parsing a tree

2010-09-10 Thread S. Doaitse Swierstra
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 *

[Haskell-cafe] problems using macports?

2010-09-09 Thread S. Doaitse Swierstra
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

[Haskell-cafe] ANNOUNCE: uu-parsinglib version 2.5.3; extended with merging combinators

2010-08-05 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] design question: decision tree from Programming Collective Intelligence

2010-08-04 Thread S. Doaitse Swierstra
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

[Haskell-cafe] Re: Fun with uu-parsinglib

2010-07-29 Thread S. Doaitse Swierstra
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: ***

Re: [Haskell-cafe] Re: ANN: weighted-regexp-0.1.0.0

2010-07-28 Thread S. Doaitse Swierstra
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,

Re: [Haskell-cafe] Re: ANN: weighted-regexp-0.1.0.0

2010-07-28 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] Techniques for ensuring parser correctness?

2010-07-26 Thread S. Doaitse Swierstra
}, bibsource = {DBLP, http://dblp.uni-trier.de} Doaitse Swierstra Techniques I'm aware of: * Round trip checks: Generate a datastructure, render as a string, parse back, and compare. Quickcheck can be used to automate this. * Fuzz testing: What tools exist to help me

Re: [Haskell-cafe] Techniques for ensuring parser correctness?

2010-07-26 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] Typeclasses question in Real World Haskell book

2010-07-26 Thread S. Doaitse Swierstra
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)]

Re: [Haskell-cafe] Regular Expression to Determinate Finite Automata translator

2010-07-22 Thread S. Doaitse Swierstra
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

[Haskell-cafe] Haddock question

2010-07-21 Thread S. Doaitse Swierstra
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: -- @

[Haskell-cafe] Haddock question

2010-07-21 Thread S. Doaitse Swierstra
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: -- @

Re: [Haskell-cafe] Tiger compiler in Haskell: annotating abstract syntax tree

2010-07-21 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] Haddock question

2010-07-21 Thread S. Doaitse Swierstra
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

[Haskell-cafe] [Ann] New version of parser combinator library uu-parsinglib-2.4.0

2010-07-21 Thread S. Doaitse Swierstra
. I hope you like the extensions, and would be happy to hear from you, both if you use them successfully, or if you have any reason for not using them. Doaitse Swierstra ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org

Re: [Haskell-cafe] Parsec combinator like Prolog's cut operator?

2010-07-03 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] Parselib sample

2010-06-02 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] Lazy Parsing (ANN: vcd-0.1.4)

2010-04-28 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] Lazy Parsing (ANN: vcd-0.1.4)

2010-04-27 Thread S. Doaitse Swierstra
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 ...

[Haskell-cafe] which version is in the platform

2010-03-22 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] which version is in the platform

2010-03-22 Thread S. Doaitse Swierstra
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:

Re: [Haskell-cafe] First time haskell - parse error!

2010-03-09 Thread S. Doaitse Swierstra
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] [] =

Re: Negation

2010-02-14 Thread S. Doaitse Swierstra
AM, Simon Marlow wrote: On 09/02/10 21:43, S. Doaitse Swierstra wrote: One we start discussing syntax again it might be a good occasion to reformulate/make more precise a few points. The following program is accepted by the Utrecht Haskell Compiler (here we took great effort to follow

Re: Negation

2010-02-09 Thread S. Doaitse Swierstra
One we start discussing syntax again it might be a good occasion to reformulate/make more precise a few points. The following program is accepted by the Utrecht Haskell Compiler (here we took great effort to follow the report closely ;-} instead of spending our time on n+k patterns), but

Re: [Haskell-cafe] Parsers for Text Adventures

2010-01-19 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] Parsers for Text Adventures; small typo corrected in example

2010-01-19 Thread S . Doaitse Swierstra
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

Re: [Haskell-cafe] Parsers for Text Adventures; in one line

2010-01-19 Thread S. Doaitse Swierstra
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)

Re: [Haskell-cafe] Parsers (Parsec and Iteratee-based Parsers)

2010-01-19 Thread S. Doaitse Swierstra
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

nomination for Haskell 2011

2009-12-23 Thread S. Doaitse Swierstra
Herewith I propose Atze Dijkstra as a member of the Haskell 2011 committee. Atze is the main architect/implementor of the Utrecht Haskell Compiler (see http://www.cs.uu.nl/wiki/UHC, and last year Haskell Symposium), and has as a result of that a very good insight in the implementation

Re: [Haskell-cafe] Wiki software?

2009-11-18 Thread S. Doaitse Swierstra
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

[Haskell-cafe] Re: uu-parsinglib pKeyword

2009-10-28 Thread S. Doaitse Swierstra
a structured language and map the results to some proper data structures. Thanks to Prof Doaitse Swierstra (and other authors if any), it is fun to write a parser using this library. I've been sending private mails to Doaitse about my questions, who kindly gives nice replies everytime

Re: [Haskell-cafe] What *is* a DSL?

2009-10-28 Thread S. Doaitse Swierstra
-Languages-languages/dp/0444001875 - http://www.agfl.cs.ru.nl/papers/agpl.ps - http://comjnl.oxfordjournals.org/cgi/content/abstract/32/1/36 Doaitse Swierstra And a general definition for parsing single-digit numbers. This works for any set of non-terminals, so it is a reusable component

Re: [Haskell-cafe] simple parsing

2009-10-28 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] Parsec bug, or...?

2009-10-20 Thread S . Doaitse Swierstra
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

[Haskell-cafe] Lecture Notes Advanced Functional programming available

2009-10-16 Thread S. Doaitse Swierstra
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:

Re: [Haskell-cafe] Parsec bug, or...?

2009-10-15 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] Parsec bug, or...?

2009-10-14 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] Re: What *is* a DSL?

2009-10-12 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] Designing a DSL?

2009-10-05 Thread S. Doaitse Swierstra
}}, Year = 2004} In a more abstract setting your question is also How do I design a library, How do I design a consistent theory, and How do I model something. These questions are harder to answer ;-} Doaitse Swierstra ___ Haskell-Cafe mailing

[Haskell-cafe] help with cabal; trying to escape from configuration hell

2009-09-22 Thread S. Doaitse Swierstra
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

[Haskell] Ph.D position, Utrecht University, the Netherlands

2009-09-08 Thread S . Doaitse Swierstra
the Computer Science department make Utrecht University the optimal surroundings for such a project. - Project leaders are Prof.dr. Doaitse Swierstra and dr. Vincent van Oostrom (principal investigator

[Haskell-cafe] Ph.D position, Utrecht University, the Netherlands

2009-09-08 Thread S. Doaitse Swierstra
/ * about this vacancy can be obtained from Doaitse Swierstra (doai...@cs.uu.nl , +31 6 4613 6929). Send your application in pdf (or another non-proprietary format) to mailto:sciencep...@uu.nl with a cc to mailto:doai...@cs.uu.nl. on or before Sept 31, 2009. Mention vacancy nr 62910

Re: [Haskell-cafe] ANN: moe html combinator

2009-08-30 Thread S . Doaitse Swierstra
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

Re: [Haskell-cafe] Parsec: using two different parser for the same string

2009-08-10 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] Parsec: using two different parser for the same string

2009-08-09 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] Possible Haskell Project

2009-06-02 Thread S. Doaitse Swierstra
it opens the eyes of the medical establishment. Doaitse Swierstra On 2 jun 2009, at 11:18, wren ng thornton wrote: Tom Hawkins wrote: At the core, the fundamental problem is not that complicated. It's just storing and retrieving a person's various health events: checkups, prescriptions

Re: [Haskell-cafe] ANN: new version of uu-parsinglib

2009-06-01 Thread S. Doaitse Swierstra
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

[Haskell-cafe] ANN: new version of uu-parsinglib

2009-05-31 Thread S. Doaitse Swierstra
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

[Haskell-cafe] Re: Lazy Parsing

2009-05-31 Thread S . Doaitse Swierstra
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

Re: [Haskell-cafe] Lazy Parsing

2009-05-29 Thread S. Doaitse Swierstra
Text.ParserCombinators.UU.Examples Doaitse Swierstra On 27 mei 2009, at 01:52, GüŸnther Schmidt wrote: Hi all, is it possible to do lazy parsing with Parsec? I understand that one can do that with polyparse, don't know about uulib, but I happen to be already somewhat familiar with Parsec, so before

Re: [Haskell-cafe] Lazy Parsing

2009-05-29 Thread S. Doaitse Swierstra
trickery! Doaitse Swierstra On 28 mei 2009, at 11:41, Malcolm Wallace wrote: Henning Thielemann schlepp...@henning-thielemann.de wrote: I don't think that it is in general possible to use the same parser for lazy and strict parsing, just because of the handling of parser failure. Polyparse

Re: [Haskell-cafe] Writing a compiler in Hakell

2009-05-06 Thread S. Doaitse Swierstra
into code for an embedded system in which case your approach does not work out. Doaitse Swierstra On 6 mei 2009, at 08:07, Rouan van Dalen wrote: Hi everyone. I am designing my own programming language. I would like to know what is the best way to go about writing my compiler in haskell

[Haskell] ANNOUNCE: uu-parsinglib-2.0.0

2009-04-28 Thread S. Doaitse Swierstra
incorprorate more of the uulib library into the new package Pros: - suggestions are welcome Doaitse Swierstra ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell-cafe] Question about implementing an off-side rule in Parsec 2

2009-04-28 Thread S. Doaitse Swierstra
. with a pBlock as we have in the uulib library to deal with the offside rule ;-} Hope you enjoy jumping into the deep, Doaitse Swierstra On 28 apr 2009, at 22:03, Bas van Gijzel wrote: Hey, Thanks for the help thusfar. These are interesting suggestions, and I think the occam-pi

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-24 Thread S. Doaitse Swierstra
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

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread S. Doaitse Swierstra
grammar based descriptions. If we had been interested in raising fierce discussions about n+k patterns or how and where cabal installs things, we could have easily achieved the same effect with much less effort. Doaitse Swierstra ___ Haskell

Re: [Haskell-cafe] Re: Haskell and C++ program

2009-01-19 Thread S. Doaitse Swierstra
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

  1   2   >