Hi I'm a Haskell newbie. I just installed Haskell on Windows 7 x64 (Haskell
Platform 2013.2.0.0 containing GHC 7.6.3), and have been using
cabal-install to build/install from Hackage all the "helper executables"
required and/or supported by EclipseFP, the Eclipse Haskell Plugin.
All the helper ex
"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 fro
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 wrote:
...
> I wish this fatal flaw would be reconsidered for the next major revision.
>
___
Haskell-Cafe mailing list
H
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 w
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 lo
bility with standard Haskell 98 and Haskell 2010 (optionally
enabled with compiler flags). Afterall Haskell now is fairly widely
used as a teaching language which befits stability as course
textbooks, lecture plans etc. can't be in hock to a language that
changes every ye
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
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
_
On 16 April 2013 16:12, Alejandro Serrano Mena 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 converted
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 wrote:
>
> Also, for some history, this was discussed a while back:
> http://www.mail-archive.com/haskell@haskell.org/msg03721.html
>
_
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 t
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 wrote:
> I am trying to install the cuda package on a Windows 7 enviroment. However I
> run into an error and
Are there any good websockets client libraries for haskell. I've been searching
for one but can only come up with server implementations.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
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 wrote:
> Did you see expression parser in parse
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 wrote:
>
> I'm interested in resurrecting the idl generator from lambada:
>
> http://www.dcs.gla.ac.uk/mail-www/haskell/msg02391.html
>
> is the code out there
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 wrote:
[...]
> I hope I have phrased this in a way to make the point. I found it a
On 2 February 2013 20:08, Sean Cormican 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 that I would benefit fr
On 30 January 2013 12:38, Ertugrul Söylemez 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 `return`.
The c
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 Ha
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 wrote:
>
>
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.
___
Haskell-C
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 wrote:
> Hey all,
>
> The connection between difference lists and accumulat
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
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
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 Synthesis
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 1
On 29 November 2012 18:09, Fixie Fixie 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 Clean to Haskell, even thoug
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.
___
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
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 wrote:
> Instead of Haskell running on the JVM is th
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
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 " `isP
MSys.
On 9 November 2012 20:13, Stephen Tetley 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
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
Haskell-Cafe@haskell.or
Hi Johan (and haskell-cafe),
I work on the Racket language (but I'm also interested in Haskell so
I've been following this list and I am consistently impressed with
what the Haskell community has produced!). In Racket, we are very
interested in the problem of inter-language operation, like what yo
Whoops - replied in haste...
There is a long extant GHC extension to elide constructor arguments
f (Leaf {}) = ...
f (Node {}) = ...
There is a recent extension for "lambda case" which you were also
using and I didn't look closely at.
On 5 November 2012 21:11, Stephen Tetley w
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`
Are Martin Erwig's "diets" anything close?
http://web.engr.oregonstate.edu/~erwig/diet/
On 29 October 2012 04:48, Tony Morris 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 => a -> [(a, a
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 (Sta
On 4 October 2012 18:04, Kim-Ee Yeoh 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 available,
that f
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
http://www.haskell.o
On 9 July 2012 15:38, Brent Yorgey 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 for Clean, the
other
On 25 June 2012 18:02, Stephen Tetley 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 lis
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
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
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 wrot
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.
I
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 "be
On 21 May 2012 17:27, Yves Parès 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 the software is
askell and generally performs well enough for "generational"
activities even if it uses Strings internally.
Best wishes
Stephen
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
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 g
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 wrote:
>
> Thanks for the suggestions. No sooner did I send my message than I came to
> the
On 8 April 2012 19:17, Myles C. Maxfield 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 should be
deterministic and d
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,
x27;s site with Conor
McBride...
On 28 March 2012 18:11, Stephen Tetley 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&
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 wrote:
> Plus one might argue that using <> to mean different is a bad choice, as it
> graphically
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 wrote:
> or perhaps
>
> infixr 0 <$$>
> (<$$>) = flip (<$>)
>
> xs <$
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...
http://www.haskell.org/pipermail/beginners/2010-January/003371.h
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
http://www.haskell.org/mailman/listinfo/haskell-
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 the
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
__
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-winde
Hi Ivan
I haven't found any bugs in WL, however I do find the API somewhat
confusing regarding line breaking (I would need to consult the manual
to tell you the difference between linebreak, softline etc.). This is
likely my failing rather than WL as usually I want formatting - "I
know the layout"
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`...
___
Haske
-users.cs.york.ac.uk/~mfn/hacle/hacle.pdf
[2] http://www.st.cs.ru.nl/papers/2010/groj10-Haskell_front_end_Clean.pdf
The paper [2] covers the Clean groups own interop between Haskell and
Clean and points to more related work alongside Matthew Naylor's.
Best wishes
St
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 wrote:
> The problem is that many of the people trying out Yesod are newcomers to
> Haskell. They are going to
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 agai
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 s
Hi Oleg - many thanks
On 6 March 2012 07:15, 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:
> http:
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?
T
e) whilst computing
the outermost type - I presume I can identify inner types as they are
resolved during Algorithm J's run...
Any solutions?
Many thanks
Stephen
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
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 "ob
On 28 February 2012 17:06, Johan Holmquist 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 -> b') -> (
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 / succe
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
d
r you need to know what
constructors you are working with so it can't be put in a "generic"
pretty print library, but the constructor specific code is
"stereotypical" so it should be easy (if boring) to write for Haskell
src-exts.
Best wishes
Stephen
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
http://www.hask
On 31 December 2011 12:26, Jerzy Karczmarczuk
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
http://www.haskell.org/ma
on language in Paul Hudak's
book. I've wanted continuous behaviours to model modulating volumes
(crescendos, decrescendos) and panning, but I've found the work tough
going for modelling the note lists where I want the system discrete in
both input (specification) and output.
Best wishes
Step
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 approa
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 f
On 21 November 2011 14:48, Yves Parès 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" version on Hackage
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, b
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 l
> Rustom Mody 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 different to '
On 20 October 2011 18:12, Rustom Mody 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 alive/active
> and w
On 19 October 2011 15:59, AM 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 Haskell with Show (represe
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 /
On 16 October 2011 10:06, Bas van Dijk 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
pick the most specif
On 15 October 2011 23:56, Bas van Dijk wrote:
> On 15 October 2011 23:17, Ertugrul Soeylemez 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 case someVector :: Vector Wo
On 4 October 2011 17:02, Karel Gardas 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 reminiscent of ASDL - th
course, the best library for "you" is the one that does more of
want you need in a way that you like the most. Social proof might not
always help for this...
Best regards
Stephen
___
Haskell-Cafe mailing list
Haskell-Cafe@haskel
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 lis
On 6 September 2011 15:33, Joachim Breitner 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
> transformation layer is indee
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
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 wrote:
> *Main> let pi = 3.14 :: MathExpression
>
__
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
gt;
> where tuple codes nodes, and Int's code edges.
>
> 2011/8/11 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 S
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.
O
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 instan
1 - 100 of 673 matches
Mail list logo