Re: [Haskell-cafe] haskore - lilypond - typesetting?

2013-08-21 Thread Stephen Tetley
Here's one I did earlier... http://www.flickr.com/photos/44929957@N03/4459628487/lightbox/ This is Haskore implementation of Chick Corea's Child Song 6 rendered to LilyPond - I don't imagine Mr. Corea's publishers will be sending me a takedown request any time soon. There's a lot missing from

Re: [Haskell-cafe] Int is broken [Was: Different answers on different machines]

2013-06-02 Thread Stephen Tetley
There was a quite long discussion here: http://conal.net/blog/posts/notions-of-purity-in-haskell On 2 June 2013 22:02, Tommy Thorn tt1...@yahoo.com wrote: ... I wish this fatal flaw would be reconsidered for the next major revision. ___ Haskell-Cafe

Re: [Haskell-cafe] [haskell.org Google Summer of Code 2013] Approved Projects

2013-05-30 Thread Stephen Tetley
Similarly (to some degree), in the ML world John Reppy had a very nice system that employed user customization via combinators rather than inference to generate application/library specific FFIs, see: http://people.cs.uchicago.edu/~jhr/papers/2006/gpce-fig.pdf On 29 May 2013 18:57, Jason Dagit

Re: [Haskell-cafe] Infrastructure for testing the impact of a Functor/Applicative/Monad hierarchy

2013-05-16 Thread Stephen Tetley
Has anyone surveyed the in-print textbooks, tutorials, or tried to assess how much Haskell (H98, H2010, Glasgow Haskell?) is used in teaching? Having the wrong hierarchy is a minor annoyance to us members of the cognoscenti, but a change outside a revision of the language standard could leave a

Re: [Haskell-cafe] Backward compatibility

2013-05-02 Thread Stephen Tetley
Hi Adrian I don't want to argue against your rant for the sake of it, but Haskell is a fairly conservative language. The Glasgow Haskell Compiler supports it's own dialect Glasgow Haskell which is fast moving, but the developers of GHC do work hard to maintain compatibility with standard Haskell

Re: [Haskell-cafe] partially applied data constructor and corresponding type

2013-04-28 Thread Stephen Tetley
What you probably want are type level integers (naturals) Yury Sulsky used them in the message above - basically you can't use literal numbers 1,2,3,... etc as they are values of type Int (or Integer, etc...) instead you have to use type level numbers: data One data Two Work is ongoing for type

Re: [Haskell-cafe] Haskell compilation errors break the complexity encapsulation on DSLs

2013-04-23 Thread Stephen Tetley
Helium - Utrecht University's simplified Haskell - had scriptable Type inference directives so the creator of an EDSL was able to augment the type checker to provide better error messages, see: Scripting the Type Inference Process Bastiaan Heeren Jurriaan Hage S. Doaitse Swierstra

Re: [Haskell-cafe] Contravariant applicatives, monads and arrows (was ANN: rematch, an library for composable assertions with human readable failure messages)

2013-04-16 Thread Stephen Tetley
On 16 April 2013 16:12, Alejandro Serrano Mena trup...@gmail.com wrote: Hi, First of all, let me say that this work on matchers is really useful :) Following Roman advice, I'm trying to find a more principled approach that could be useful for this library. It seems that Match could easily be

Re: [Haskell-cafe] Prolog-style patterns

2013-04-08 Thread Stephen Tetley
This is a recurring theme, see also here: http://www.haskell.org/pipermail/haskell-cafe/2009-May/061498.html On 8 April 2013 16:53, Tom Murphy amin...@gmail.com wrote: Also, for some history, this was discussed a while back: http://www.mail-archive.com/haskell@haskell.org/msg03721.html

Re: [Haskell-cafe] graphical editor links ?

2013-04-01 Thread Stephen Tetley
A while ago there was a framework Blobs for building box-connector diagram editors. It is probably a somewhat bit-rotted now: http://www.cs.york.ac.uk/fp/darcs/Blobs/ I seem to remember a Haskell Workshop report about Dazzle (the application that was the genesis of Blobs) but it doesn't appear

Re: [Haskell-cafe] install cuda

2013-03-31 Thread Stephen Tetley
It looks like you are using Cygwin for a Unix-alike environment. For building Haskell bindings to C libraries you are better off with MinGW + MSYS. On 30 March 2013 19:43, Peter Caspers pcaspers1...@gmail.com wrote: I am trying to install the cuda package on a Windows 7 enviroment. However I

Re: [Haskell-cafe] Parser left recursion

2013-02-20 Thread Stephen Tetley
More primitively, Parsec and its predecessor Hutton-Meijer provide the chainl/chainr combinators, these automatically remove left recursion within the parser - i.e. you don't have to rewrite the grammar. On 20 February 2013 08:19, Dmitry Olshansky olshansk...@gmail.com wrote: Did you see

Re: [Haskell-cafe] searching the attic for lambada

2013-02-13 Thread Stephen Tetley
Hi John I have a copy of version 0.1 and a related PDF - I'll email you as attachments them offlist On 13 February 2013 14:16, John Lask jvl...@hotmail.com wrote: I'm interested in resurrecting the idl generator from lambada: http://www.dcs.gla.ac.uk/mail-www/haskell/msg02391.html is the

Re: [Haskell-cafe] CoArbitrary

2013-02-09 Thread Stephen Tetley
I think GAST - the Clean equivalent of Quickcheck - generates functions. There are certainly quite a few papers by members of the Clean team documenting how they generate them. On 9 February 2013 07:07, Tony Morris tonymor...@gmail.com wrote: [...] I hope I have phrased this in a way to make the

Re: [Haskell-cafe] Parsec Vs. src exts

2013-02-03 Thread Stephen Tetley
On 2 February 2013 20:08, Sean Cormican seancormic...@gmail.com wrote: Can anybody provide me with some guidance on whether to try and create the parser using Parsec or if haskell-src is a better option. In the case that haskell-src is a better option, are there any tutorials or documents

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

2013-01-30 Thread Stephen Tetley
On 30 January 2013 12:38, Ertugrul Söylemez e...@ertes.de wrote: A monadic parser /is/ a combinator parser. The code you linked just doesn't go as far as wrapping it up with a newtype and providing a monad instance. Further, (+) in the linked example is monadic bind and `result` is

Re: [Haskell-cafe] resources for learning Hindley-Milner type inference for undergraduate students

2013-01-18 Thread Stephen Tetley
There is a summary paper by Sunil Kothari and James L. Cladwell covering the algorithms M, J and W with informal presentations plus code available in Ocaml. Paper is on Citeseer, code is available from Sunil Kothari's home page. Martin Grabmueller has a tutorial implementation of algorithm W in

Re: [Haskell-cafe] Generating random arguments for a function

2013-01-13 Thread Stephen Tetley
In general you can't do this whether you use pats of QuickCheck or not - `randomEvalute` would need to inspect the supplied function to see how many input parameters it has so it can list them, but there is no such introspection in Haskell. ___

Re: [Haskell-cafe] Generating random arguments for a function

2013-01-13 Thread Stephen Tetley
Yes - I was just checking the first QuickCheck paper to see how the authors did this. You would need a new type class that works like `Testable` and the versions of associated machinery `forAll` and `evaluate` to unroll function application. On 13 January 2013 09:28, Roman Cheplyaka

Re: [Haskell-cafe] Difference Lists versus Accumulators

2013-01-08 Thread Stephen Tetley
See the first Worker / Wrapper paper by Andy Gill and Graham Hutton. Particularly there is exactly this derivation of reverse through preliminarily using a Hughes (difference) list. On 8 January 2013 12:22, Edsko de Vries edskodevr...@gmail.com wrote: Hey all, The connection between difference

Re: [Haskell-cafe] Navigating 'Strategic' programming babel

2012-12-17 Thread Stephen Tetley
Strafunski is now rather out of date - it was developed before Cabal and used a custom install depending whether or not you wanted to use the DriFt preprocessor. Andy Gill has a modern re-implementation of Strafuski on Hackage called KURE. Aside from SYB, Neil Mitchell's Uniplate is popular and

Re: [Haskell-cafe] Exploring Programming Language Theory

2012-12-09 Thread Stephen Tetley
If you want compiling functional languages and can relax the requirement for up to date: Antoni Diller's Compiling Functional Languages is good. It is short enough (300 pages) that you could reasonably work through it and it includes the full source of a compiler in the appendix - written in

Re: [Haskell-cafe] Design of a DSL in Haskell

2012-12-04 Thread Stephen Tetley
In Haskell, shallow DSLs generate values - deep DSLs generate structures (typically abstract syntax trees), the structure can subsequently be used to generate a value (or a C program, or a HTML page, etc.). See Andy Gill and colleagues Types and Type Families for Hardware Simulation and

Re: [Haskell-cafe] Is there any movement/need in new 'base' package and co?

2012-12-02 Thread Stephen Tetley
Haskell 2010 avoided library revisions - 12 years had elapsed since the last language definition and updating the language was deemed the priority. There have been suggestions on the Libraries list that the next major language revision should also look at the core libraries. On 2 December 2012

Re: [Haskell-cafe] To my boss: The code is cool, but it is about 100 times slower than the old one...

2012-11-29 Thread Stephen Tetley
On 29 November 2012 18:09, Fixie Fixie fixie.fi...@rocketmail.com wrote: What is your experience, dear haskellers? To me it seems this beautiful language is useless without a better lazy/eager-analyzer. Since when has speed been the sole arbiter of utility? 10 years ago I switched from

Re: [Haskell-cafe] OpenAL - compiling problem

2012-11-28 Thread Stephen Tetley
Hi Gary Which version of GHC are you using? My suspicion is that ALCdevice might be a newtype falling foul of recent changes to GHC... v7.4.1: GHC now requires, as per the standard, that if a newtype is used in an FFI declaration, then the constructor for that type must be in scope. For now you

Re: [Haskell-cafe] OpenAL - compiling problem

2012-11-28 Thread Stephen Tetley
I think OpenAL is now unmaintained. You could try to find AndrewMiller who updated the last version, otherwise you might have to patch it yourself or ask a developer of a dependent package if they would consider pushing another unmaintained release to Hackage.

Re: [Haskell-cafe] Instead of Haskell running on the JVM is there a way for Haskell to call a JVM language ...

2012-11-20 Thread Stephen Tetley
There has been, as Antony Courtney was using Java2D for vector graphics called from Haskell in his Haven system. The FFI was GCJNI (Green Card JNI) - I'm not sure where it exists now or how much it has bit rotted. On 20 November 2012 05:36, KC kc1...@gmail.com wrote: Instead of Haskell running

Re: [Haskell-cafe] Parsing different types, same typeclass

2012-11-18 Thread Stephen Tetley
With existentials an extesible version might look like this: {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE ScopedTypeVariables #-} ... class Action and datatypes A and B the same as before ... -- some new ones... data C = C Int deriving (Read, Show) instance Action

Re: [Haskell-cafe] Parsing different types, same typeclass

2012-11-17 Thread Stephen Tetley
Being concrete, all you can do is: parseAction :: String - Either A B parseAction str | (A `isPrefixOf` str = Left $ read str | (B `isPrefixOf` str = Right $ read str parseAction :: String - Int parseAction str | (A `isPrefixOf` str = run $ (read str :: A) | (B `isPrefixOf`

Re: [Haskell-cafe] curl package broken in Windows

2012-11-09 Thread Stephen Tetley
Isn't Curl a C library (with a Haskell binding)? For Haskell bindings the best environment on Windows is usually MinGW / MSys, but your error suggests you should be building from Cygwin in this case. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] curl package broken in Windows

2012-11-09 Thread Stephen Tetley
:13, Stephen Tetley stephen.tet...@gmail.com wrote: Isn't Curl a C library (with a Haskell binding)? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Partial application in case expression rules

2012-11-05 Thread Stephen Tetley
There's a Glasgow extension that gets you to this: treeFold :: (a - a - a) - Tree a - a treeFold f = \case Leaf {} - id Node {} - f `on` treeFold f Or maybe this if parens are needed: treeFold :: (a - a - a) - Tree a - a treeFold f = \case (Leaf {}) - id (Node {}) - f `on` treeFold f

Re: [Haskell-cafe] Segment Tree based Set

2012-10-29 Thread Stephen Tetley
Are Martin Erwig's diets anything close? http://web.engr.oregonstate.edu/~erwig/diet/ On 29 October 2012 04:48, Tony Morris tonymor...@gmail.com wrote: Hi, I was wondering if anyone knows of a package implementing a fast lookup for an element in ranges. For example, this operation: Ord a =

Re: [Haskell-cafe] serialize an unknown type

2012-10-24 Thread Stephen Tetley
Hi Corentin It looks like you are writing the event handler on the server side. If so, the range of events you can handle is fixed to just those you implement handlers for - having an openly extensible event type is useless if this is the case. Ignoring client/server for a moment, a function

Re: [Haskell-cafe] Which advanced Haskell topics interest you

2012-10-04 Thread Stephen Tetley
On 4 October 2012 18:04, Kim-Ee Yeoh k...@atamo.com wrote: Something to consider is that it's not so much whether the material is basic, advanced, or intermediate; it's that the way it's being presented is boring and ineffective. I'd suggest there is enough range in the Haskell books now

Re: [Haskell-cafe] type variable in class instance

2012-09-10 Thread Stephen Tetley
Whilst dynamic typing isn't idiomatic for Haskell, it seems like you've decided you want it. So why not use Data.Dynamic rather than roll you're own dynamic typing with Typeable? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Best way to build a GHC backend?

2012-07-09 Thread Stephen Tetley
On 9 July 2012 15:38, Brent Yorgey byor...@seas.upenn.edu wrote: I should point out that the ball already IS rolling -- ranging from EDSLs that compile to JavaScript [1,2] to macro systems [3] to more serious full-featured efforts [4,5]. Also, a JavaScript backend has recently been developed

Re: [Haskell-cafe] Origin of Delimited Continuation Operators

2012-06-25 Thread Stephen Tetley
You could try working back from the references in Dorai Sitaram's Handling Control 1993, which is an important paper in the Scheme community covering this area. http://www.cs.rice.edu/CS/PLT/Publications/Scheme/pldi93-s.ps.gz Shift for instance is referenced back to at least Davy and Filinski's

Re: [Haskell-cafe] Origin of Delimited Continuation Operators

2012-06-25 Thread Stephen Tetley
On 25 June 2012 18:02, Stephen Tetley stephen.tet...@gmail.com wrote: Shift for instance is referenced back to at least Davy and Filinski's Abstracting Control 1990. Typo - Olivier _Danvy_ not Davy ___ Haskell-Cafe mailing list Haskell-Cafe

Re: [Haskell-cafe] Martin Odersky on What's wrong with Monads

2012-06-24 Thread Stephen Tetley
False! You only have to change the parts of the program that need the effect that the monad provides. A well designed program will likely have much of its code in pure libraries. Think of the monadic code as a scripting language that you bind your libraries together with to make the program. On

Re: [Haskell-cafe] Haskell is rapidly approaching the top 20

2012-06-17 Thread Stephen Tetley
Ah, enjoy it while it lasts. In April, Kuzcek PLT Institut, Kazakhstan [*] and the Club of Rome declared 2012 as the year of Peak FP. It's downhill from here on… [*] aka @plt_borat on Twitter - whose views are probably no more unreliable than Tiobe. On 16 June 2012 22:58, Henk-Jan van Tuyl

Re: [Haskell-cafe] Finding the average in constant space

2012-05-27 Thread Stephen Tetley
There are a few blog posts by Conal Elliott and Max Rabkin (I think) reifying folds as a data type to get more composition and thus fold different functions at the same time. Search for beautiful folding with the above authors names. Personally I didn't find the examples significantly more

Re: [Haskell-cafe] Building pattern and trying monads

2012-05-27 Thread Stephen Tetley
It's common to use a writer monad possibly stacked with other monads (e.g. a state monad for fresh variable names) for code generation that approximates macro expansion - i.e. one call in Haskell maps to one-or-more lines of code in the output language, no global transformations are permitted. If

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-21 Thread Stephen Tetley
On 21 May 2012 17:27, Yves Parès yves.pa...@gmail.com wrote: I fail to see how the GUI part would suffer from lack of performance if the rest of the system is fine. I would hate to be bold, but to me this case sounds a little bit like MVC done wrong if the breaking GUI apart from the rest of

Re: [Haskell-cafe] darcs patch dependencies in dot format

2012-05-16 Thread Stephen Tetley
On 16 May 2012 19:43, wren ng thornton w...@freegeek.org wrote: You should probably farm out the toDot rendering to one of the libraries that focuses on that[1], since they'll have focused on the efficiency issues--- or if they haven't, then you can contribute improvements there, helping

Re: [Haskell-cafe] Data-Type Serialization

2012-04-23 Thread Stephen Tetley
I think both ATerms and the Zephyr project's ASDL could handle recursive types - certainly ASDL was a sum and product representation like ML or Haskell's algebraic types (ATerms were a bit more like Prolog). Both never gained much traction and for better or worse JSON won the game. I implemented

Re: [Haskell-cafe] prettyprint with IO

2012-04-13 Thread Stephen Tetley
Haskell-src-exts has had a monadic wrapper over HughesPJ for a long time. It is just a Reader (not a transformer) so it can handle user supplied spacing widths, etc. On 13 April 2012 06:02, Warren Harris warrensomeb...@gmail.com wrote: Thanks for the suggestions. No sooner did I send my

Re: [Haskell-cafe] Mixing Unboxed Mutable Vectors and Parsers

2012-04-08 Thread Stephen Tetley
Hi Myles It seems odd to mix parsing (consuming input) with mutation. What problem are you trying to solve and are you sure you can't get better phase separation than this paragraph suggests? My first idea was to simply parse all the deltas, and later apply them to the input list. However, I

Re: [Haskell-cafe] Mixing Unboxed Mutable Vectors and Parsers

2012-04-08 Thread Stephen Tetley
On 8 April 2012 19:17, Myles C. Maxfield myles.maxfi...@gmail.com wrote: It's a JPEG parser. Ahem, I'm a bit of of my depth then, but one thing you should consider is that writing your own parser monad is trivial, especially for well defined binary formats. Well defined binary formats

Re: [Haskell-cafe] Fail-back monad

2012-04-05 Thread Stephen Tetley
with Conor McBride... On 28 March 2012 18:11, Stephen Tetley stephen.tet...@gmail.com wrote: Maybe this is a version of William Harrison's DebugT monad with rollback, listed in his periodic table of effects? http://www.cs.missouri.edu/~harrisonwl/Presentations/UIUCFM05.ppt I've never seen

Re: [Haskell-cafe] Generalizing (++) for monoids instead of using ()

2012-04-02 Thread Stephen Tetley
It is somewhat idiomatic to read it as TeX's \diamond symbol. Various papers set with Lhs2TeX use it for general composition operator (sometimes concat / mappend). On 2 April 2012 10:05, Yves Parès yves.pa...@gmail.com wrote: Plus one might argue that using to mean different is a bad choice, as

Re: [Haskell-cafe] for = flip map

2012-03-30 Thread Stephen Tetley
I've always thought this was missing for parser combinator libraries as there is the notational tradition from YACC etc. to have production at the left then action at the right. On 29 March 2012 22:03, Sjoerd Visscher sjo...@w3future.com wrote: or perhaps    infixr 0 $$    ($$) = flip ($)  

Re: [Haskell-cafe] Fail-back monad

2012-03-28 Thread Stephen Tetley
Maybe this is a version of William Harrison's DebugT monad with rollback, listed in his periodic table of effects? http://www.cs.missouri.edu/~harrisonwl/Presentations/UIUCFM05.ppt I've never seen a definition of the monad itself...

Re: [Haskell-cafe] How to handle C library dependencies on Hackage?

2012-03-25 Thread Stephen Tetley
Hi Christian Usually people host the documentation on their own site and put a link in the description field of the cabal file, pointing users to it. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Un-memoization

2012-03-22 Thread Stephen Tetley
Hi Victor There was a paper at one of the early PADL conferences describing out-out-core data structures in Ocaml. I've never seen anyone following up this work, possibly because RAM has got so cheap in the last decade. If you have such large trees you may find the paper interesting. Although

Re: [Haskell-cafe] MSIL manipulation libraries

2012-03-21 Thread Stephen Tetley
I think there are two libraries for CIL on Hackage, one is for Microsoft's CIL (aka MSIL) the other is for George Necula et als CIL (C Intermediate Language). Obviously you want the one for Microsoft CIL. http://hackage.haskell.org/package/language-cil

Re: [Haskell-cafe] HughesPJ vs. Wadler-Leijen

2012-03-20 Thread Stephen Tetley
A quick suggestion - does setting the ribbon_frac to something like 0.8 improve things? The Show instance for wl-pprint's Doc uses 0.4 which I've found too low. This means you'll have to write your own display function using `renderPretty`... ___

Re: [Haskell-cafe] HughesPJ vs. Wadler-Leijen

2012-03-20 Thread Stephen Tetley
Ahem - there was a severe typo in my last message. Usually I wouldn't spam the list to repair my failings but edit distance on the error in that message was so large it made no sense at all. printing that cannot be undone by `group`, or the combinators that use group are given more long-winded

Re: [Haskell-cafe] Google Summer of Code idea of project application

2012-03-19 Thread Stephen Tetley
Hi Damien A translator might be a lot of work. Matthew Naylor had a translator between Haskell and Clean [1], which performed well according to [2]. The translator was his Master project in the UK so I think that means it would represent approximately a years work. [1]

Re: [Haskell-cafe] cabal-install problem with alex dependency in bytestring-lexing

2012-03-16 Thread Stephen Tetley
Alex is supplied as part of the Platform though which is the recommended system for beginners, is Yesod currently in advance of the Platform? On 16 March 2012 10:56, Erik de Castro Lopo mle...@mega-nerd.com wrote: The problem is that many of the people trying out Yesod are newcomers to

Re: [Haskell-cafe] Adding type annotations to an AST?

2012-03-14 Thread Stephen Tetley
Hi Sean Many thanks - the note on flow-issues might be particularly helpful for me (last para section 4 introduction). My current code has a bug which maybe this identifies. I'm currently using a modified algorithm M which I believe is top down, I'll switch to algorithm W. Thanks again Stephen

Re: [Haskell-cafe] using mutable data structures in pure functions

2012-03-12 Thread Stephen Tetley
There is a trick to `nub` where you couldn't implement the internal lookup list with an (assumed faster) search tree anyway. `nub` only mandates equality not ordering, so building a ordered structure like a binary tree is impossible. In practice i would be hard to beat list as the intermediate

Re: [Haskell-cafe] Adding type annotations to an AST?

2012-03-06 Thread Stephen Tetley
Hi Oleg - many thanks On 6 March 2012 07:15, o...@okmij.org wrote: How do I add type annotations to interior locations in an abstract syntax tree? {Snip}        Here is the solution http://okmij.org/ftp/Computation/FLOLAC/TEvalNR.hs        There is a bit of the explanation here:

Re: [Haskell-cafe] Adding type annotations to an AST?

2012-03-05 Thread Stephen Tetley
Partially answering my own question - it seems like I want type directed translation as per section 8 of Practical Type Inference for Arbitrary Ranked Types. Does anyone know of a presentation with a simpler type language? Thanks again Stephen ___

[Haskell-cafe] Adding type annotations to an AST?

2012-03-04 Thread Stephen Tetley
Hello All How do I add type annotations to interior locations in an abstract syntax tree? I have a small ML language where programs are a single expression, but the expression type has let-rec so it supports recursive function definitions. Source programs have no type annotations. I want to

Re: [Haskell-cafe] Impact of try on Parsec performance

2012-03-03 Thread Stephen Tetley
I'd suggest `try` can make parsers had to debug and fragile when refactoring. `try` is very useful for char parsers, where you don't really want to be sharing a prefix amongst different parsers. For regular parsers you have equivalents of the EBNF operators plus the `sepBy` etc. parsers so the

Re: [Haskell-cafe] Does somebody know about these functions?

2012-02-28 Thread Stephen Tetley
On 28 February 2012 17:06, Johan Holmquist holmi...@gmail.com wrote: Function 'withPair' takes a pair and applies a function to it's first element, another function to it's second element and finally combines the results with yet another function. withPair :: (a' - b' - c) - (a - a') - (b -

Re: [Haskell-cafe] Using multiplate to get free variables from a syntax tree

2012-02-24 Thread Stephen Tetley
I'm not familiar with Multiplate either, but presumably you can descend into the decl - collect the bound vars, then descend into the body expr. Let $ decl child d * expr child e This seems like a common traversal that Strafunski would handle, and with Multiplate being a competitor / successor

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread Stephen Tetley
There is also the DMS from Ira Baxter's company Semantic Design's. This is an industry proven refactoring framework that handles C++ as well as other languages. I think the Antlr C++ parser may have advanced since the article Antoine Latter link to, but personally I'd run a mile before trying to

Re: [Haskell-cafe] generating parens for pretty-printing code in haskell-src-exts

2012-01-14 Thread Stephen Tetley
Hi Conal I don't know if any Haskell src-exts code exists. Norman Ramsey has published an algorithm for it, plus ML code: http://www.cs.tufts.edu/~nr/pubs/unparse-abstract.html I've transcribed the code to Haskell a couple of times for small expression languages. As far as I remember you need

Re: [Haskell-cafe] Are all monads functions?

2011-12-31 Thread Stephen Tetley
On 31 December 2011 12:26, Jerzy Karczmarczuk jerzy.karczmarc...@unicaen.fr wrote: Yves Parès : all standard Monads are newtypes wrapping functions What about Maybe and [] ? And Identity ... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Avoiding parametric function binding

2011-12-31 Thread Stephen Tetley
Maybe you want a deconstructor (sometime called an eliminator)? deconsVar :: (Maybe Int - a) - (Maybe String - a) - Var - a deconsVar f g (V1 a) = f a deconsVar f g (V2 b) = g b ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] MIDI-controlled application

2011-12-27 Thread Stephen Tetley
Hi Tim Events in FRP / Yampa are typically key presses / mouse movement, so a MIDI controller generating Note-on / Note-off events would be a direct analogue to key presses. More problematic is that FRP models hybrid (continuous and discrete) systems. For me at least, MIDI seems essentially

Re: [Haskell-cafe] Generating Code

2011-12-09 Thread Stephen Tetley
Geoffrey Mainland did significant work generating C with his GHC quasi quote extension. I'm not sure the status or availability of the code but there was a good Haskell Workshop paper describing it. For the specific problem of OpenGL - as the package already exists I'm not sure a generative

Re: [Haskell-cafe] Anonymous, Unique Types, maybe

2011-12-03 Thread Stephen Tetley
Umm, an obvious point is that if you really are using lists as streams they should appear infinite to the processing code, so you shouldn't encounter operations that fail due to incompatible lengths. Otherwise I think there might be packages on Hackage for fixed sized lists, its a common example

Re: [Haskell-cafe] Interpreter with Cont

2011-11-21 Thread Stephen Tetley
On 21 November 2011 14:48, Yves Parès limestr...@gmail.com wrote: I've read Martin Erwig and Steve Kollmansberger's Probabilistic functional programming in Haskell. Does someone know if the library they are talking about is available on hackage? Henning Thielemann has a batteries included

Re: [Haskell-cafe] Tutorial/slides on pretty-printing combinators?

2011-11-16 Thread Stephen Tetley
Hi Sean Doaiste Swierstra has fairly extensive notes on the development of the attribute grammar versions of uulib's pretty printers. The notes are called Designing and Implementing Combinator Languages. As they were a showcase for UUAG there is quite a lot on attribute grammars in the notes,

Re: [Haskell-cafe] deepseq-1.2.0.1 missing Data.Map instance

2011-11-15 Thread Stephen Tetley
Hello Henry I think it is a case of the dependency changing recently from deepseq depending on containers to containers depending on deepseq. Thus you want to check you are using compatible versions of deepseq and containers. ___ Haskell-Cafe mailing

Re: [Haskell-cafe] ANN: diagrams 0.4

2011-10-24 Thread Stephen Tetley
Rustom Mody rustompm...@gmail.com writes: I remember (vaguely) a 'live page' ie where one could enter (into the browser) changes to the diagrams code and see the results immediately. Is that page there? (Or am I mixing up with something else?) Maybe it was Péter Diviánszky's 'dia' (entirely

Re: [Haskell-cafe] lost in generics

2011-10-20 Thread Stephen Tetley
On 20 October 2011 18:12, Rustom Mody rustompm...@gmail.com wrote: I need some help finding my way around the various generics libraries. My usage scenario is -- at least to start with -- the ASTs of programming languages. In general my question is:  What is alive/active and what is

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-19 Thread Stephen Tetley
On 19 October 2011 15:59, AM age...@themactionfaction.com wrote: Note that other programming languages have had to solve this exact problem and they usually end up with multiple functions- one for debugging, one for serialization, one for displaying how the object was constructed. As per

Re: [Haskell-cafe] Comparison Haskell, Java, C and LISP

2011-10-18 Thread Stephen Tetley
Haskell has no support for reflection whatsoever. It can support compile time meta-programming with Template Haskell. Reflection itself might be antagonistic to functional programming, I suspect it is at odds with referential transparency. Most of the work on reflection seemed based around Lisp

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-16 Thread Stephen Tetley
On 15 October 2011 23:56, Bas van Dijk v.dijk@gmail.com wrote: On 15 October 2011 23:17, Ertugrul Soeylemez e...@ertes.de wrote: Both instances are valid here, and there is no mechanism to choose one of them. There is: OverlappingInstances[1] chooses the most specific instance. So in

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-16 Thread Stephen Tetley
On 16 October 2011 10:06, Bas van Dijk v.dijk@gmail.com wrote: But is this a problem when both instances are exported from the same module and OverlappingInstances is only enabled in that module, as is the case here? No - if the only instances defined are in the same module GHC would

Re: [Haskell-cafe] DSL for data definition (e.g. compiling Haskell type defs into Google's protocol buffers type defs)

2011-10-04 Thread Stephen Tetley
On 4 October 2011 17:02, Karel Gardas karel.gar...@centrum.cz wrote: Hello, [SNIP] So basically speaking I'm thinking about using Haskell sub-set as a data-definition DSL together with some functions which will generate some code based on supplied defined data types. ... This seems

Re: [Haskell-cafe] hackage library info

2011-09-20 Thread Stephen Tetley
Hi There have been plans to add rankings to Hackage and a GSOC looked into adding them. Roel van Dijk built reverse dependencies for Hackage which illustrated the most popular libraries, unfortunately the link seems broken: http://bifunctor.homelinux.net/~roel/hackage/packages/hackage.html Of

Re: [Haskell-cafe] Categorized Weaknesses from the State of Haskell 2011 Survey

2011-09-12 Thread Stephen Tetley
Replying to someone's compliant in the first section: Malcolm Wallace and Colin Runciman's ICFP99 paper functioned well as a tutorial for HaXml when I used it - maybe it is a bit out of date now? HaXml is hardly a dire case. ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Solving the configuration problem with parametrized modules

2011-09-06 Thread Stephen Tetley
On 6 September 2011 15:33, Joachim Breitner m...@joachim-breitner.de wrote: I think the benefit you get from being able to treat runtime constants as plain values manifests mostly when writing pure code. If your code has already been written or re-written in monadic style, adding a

Re: [Haskell-cafe] Smarter do notation

2011-09-04 Thread Stephen Tetley
It seems like complication for very slight advantage. Firstly, so far only UU Parsing and Trifecta appear to have optimized Applicative instances (does the optimization work for mixed Monad+Applicative parsers or only if the whole parser is Applicative?). Secondly if you want Applicative then you

Re: [Haskell-cafe] Question about data

2011-08-19 Thread Stephen Tetley
Others have pointed out your first bug. To get floating-point numeric literals you will need to define instances of Num and then Fractional for your symbolic type. On 19 August 2011 21:40, Paul Reiners paul.rein...@gmail.com wrote: *Main let pi = 3.14 :: MathExpression

Re: [Haskell-cafe] Hiding growing state using existentials.

2011-08-16 Thread Stephen Tetley
You can't define (=) if your state type changes: (=) :: m a - (a - m b) - m c Whereas, your bind is effectively three different parametric types: _bind :: m1 a - (a - m2 b) - m3 b You can use parametric monads to represent state changing within a monad. Oleg Kiselyov has tutorials on their use

Re: [Haskell-cafe] library on common sub-expression elimination?

2011-08-11 Thread Stephen Tetley
Wouldn't this be dependent upon your AST and thus not readily package-able as a library? Expression simplification has been a prime example for Strafunski style traversal libraries. You might be able to find examples that you can adapt to your own AST written with Uniplate or similar library. On

Re: [Haskell-cafe] library on common sub-expression elimination?

2011-08-11 Thread Stephen Tetley
, and Int's code edges. 2011/8/11 Stephen Tetley stephen.tet...@gmail.com Wouldn't this be dependent upon your AST and thus not readily package-able as a library? Expression simplification has been a prime example for Strafunski style traversal libraries. You might be able to find examples that you

Re: [Haskell-cafe] Idiomatic ways to make all instances of a certain class also instances of another?

2011-07-26 Thread Stephen Tetley
For: instance (Ord a) = Max a where maximum = max The same could more simply be achieved with a function: maximum :: Ord a = a maximum = max Now, you probably wanted both a base-case using max and type specific, special cases: instance Max Int where maximum = 2^16 If you have both

Re: [Haskell-cafe] Grammar hacker in Haskell

2011-07-22 Thread Stephen Tetley
The algorithms are common practice and a web search should provide lecture notes detailing them - you will likely have to translate to Haskell yourself. If you have a university affiliation, I'd go to the library and check books on compiler construction. The classic is the Dragon Book -

Re: [Haskell-cafe] Introspection

2011-07-22 Thread Stephen Tetley
As Haskell is statically typed, if y.length 100, y is still of type Big... On 22 July 2011 10:18, Patrick Browne patrick.bro...@dit.ie wrote: 2) Assert the type of a variable e.g. if y.length 100 then y is of type big. ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Grammar hacker in Haskell

2011-07-22 Thread Stephen Tetley
On 22 July 2011 16:32, Johannes Waldmann waldm...@imn.htwk-leipzig.de wrote: Stephen Tetley stephen.tetley at gmail.com writes: Compilers: Principles, Techniques, and Tools by Aho et al. though the presentation in this book is quite formal. you make that sound like a bad thing ... Well

Re: [Haskell-cafe] Constructor discipline and dependent types.

2011-07-17 Thread Stephen Tetley
On 17 July 2011 10:03, Patrick Browne patrick.bro...@dit.ie wrote: Question 1: Is the above a reasonable understanding of CD? From a brief look, constructor discipline (CD) restricts left-hand sides of equations to have no function calls themselves.

Re: [Haskell-cafe] Baffling Hackage build log

2011-07-13 Thread Stephen Tetley
This seems to be a general problem with the Hackage server as other packages uploaded after yours have failed to build with similar errors... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

  1   2   3   4   5   6   >