Re: [Haskell-cafe] hmatrix's fitModel function crashes ghc(i)

2010-11-07 Thread Roel van Dijk
Thank you for your reply. I will follow progress on the ticket.

On Mon, Nov 8, 2010 at 3:57 AM, Vivian McPhail
 wrote:
> Here's the ticket:
>
> http://hackage.haskell.org/trac/ghc/ticket/781
>
> They aim to fix the problem (with fPIC) by ghc 7.2.
>
> Cheers,
>
> Vivian
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANNOUNCE: arrow-list. List arrows for Haskell.

2010-11-07 Thread Sebastian Fischer

to answer my own question:

On Nov 7, 2010, at 8:33 PM, Sebastian Fischer wrote:

Can you, for example, define a `perm` arrow that yields every  
permutation of it's input? Monadic implementations look like they  
need `>>=` but there may be another way..


A `perm` arrow can be defined in the "usual" way using the list-arrow  
package:


{-# LANGUAGE TypeOperators #-}

import Control.Arrow
import Control.Arrow.ArrowList

perm :: (ArrowList (~>), ArrowPlus (~>)) => [a] ~> [a]
perm = isA null <+> (uncons >>> second perm >>> insert)

insert :: (ArrowList (~>), ArrowPlus (~>)) => (a,[a]) ~> [a]
insert = cons <+> (second uncons >>> rearrange >>> second insert  
>>> cons)

 where rearrange = assocL >>> first swap >>> assocR

It may be possible to do this with `ArrowChoice` only, that is,  
without resorting to the operations of `ArrowList`, but they looked  
simpler.


In order to support the above, we need a bunch of auxiliary arrows.  
First, list con- and destructors:


cons :: Arrow (~>) => (a,[a]) ~> [a]
cons = arr (uncurry (:))

uncons :: ArrowList (~>) => [a] ~> (a,[a])
uncons = isA (not . null) >>> arr (\ (x:xs) -> (x,xs))

Second (and more annoyingly), "reordering" arrows:

swap :: Arrow (~>) => (a,b) ~> (b,a)
swap = arr (\ (x,y) -> (y,x))

assocL :: Arrow (~>) => (a,(b,c)) ~> ((a,b),c)
assocL = arr (\ (x,(y,z)) -> ((x,y),z))

assocR :: Arrow (~>) => ((a,b),c) ~> (a,(b,c))
assocR = arr (\ ((x,y),z) -> (x,(y,z)))

This is my first program with arrows so it might be unnecessarily  
complicated. Is there a more elegant way?


I wonder how badly my use of `arr` influences how the program can be  
optimized.  I hope it's still better than just using


perm = arrL perms
 where perms :: [a] -> [[a]]
   perms = ...

;o)

Sebastian
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] hmatrix's fitModel function crashes ghc(i)

2010-11-07 Thread Vivian McPhail
On 7 November 2010 15:19, Vivian McPhail
wrote:

>
> Message: 29
>> Date: Sat, 6 Nov 2010 13:22:10 +0100
>> From: Roel van Dijk 
>> Subject: [Haskell-cafe] hmatrix's fitModel function crashes ghc(i)
>> To: Haskell Caf? 
>> Message-ID:
>>
>> Content-Type: text/plain; charset=UTF-8
>>
>> Hello,
>>
>> I would like to use hmatrix to do some function fitting with the
>> Levenberg Marquardt algorithm. As an example I would like to fit the
>> very simple function "f x = a*x + b" on some data points. The problem
>> is that executing the 'fitModel' function crashes GHC(i) with a
>> segmentation fault. This makes debugging difficult. Can anyone spot
>> what I am doing wrong? Given all the lists of Double's it seems very
>> easy to make an error regarding the number of arguments with the model
>> function or the derivative.
>>
>
> I think the problem is with linking static data in GHCi on x86_64.
>
> Hope this helps.  I seem to recall there might be a ghc trac ticket related
> to this but a quick search turned up nothing.
>
> Here's the ticket:

http://hackage.haskell.org/trac/ghc/ticket/781

They aim to fix the problem (with fPIC) by ghc 7.2.

Cheers,

Vivian
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How can I use MACID in my existing application?

2010-11-07 Thread Jeremy Shaw

Hello,

Retrofitting MACID will not be trivial because it makes different  
assumptions that permeate your code.


It sounds like your game is possibly multithreaded / multiplayer. But,  
the Game is stored the StateT monad. So I assume only one thread  
updates the GameState ? Is the Game state per-player or is there only  
one global game state ?


In your current app, any code in the GameState monad can update the  
state at any time, and IO can be freely intermixed. There are no  
really boundaries separating one state update from another -- it is a  
continual process with no clear separate events.


MACID will be a lot closer to a traditional database where you perform  
a distinct 'query' operation which updates or reads the state.


Each update or query you wanted to perform on the state would become a  
separate isolated function which gets registered with the transaction  
system (using mkMethod). You would then perform those transactions  
using the update and query functions (which run in the IO monad). So  
you would get rid of the GameState monad, and just have Comm.


MACID also deals with the issue of multiple threads trying to update  
the state -- but that may not be a problem you care about if you only  
have one thread.


One question is, what exactly are you trying to achieve.

If you simple want to checkpoint your game state now and then, you  
could use just happstack-data. It provides versioned binary  
serialization and migration. That would allow you to save the entire  
state now and then, and migrate the data when the game state format  
changed.


MACID builds on that to add the ability to log every 'update' event  
that occurs so that you can replay the events if the server crashes  
between checkpoints. (It also allows for distributed state across  
multiple servers). But in order to log an event, the app has to first  
have things when can be clearly identified as a single 'event'. And  
you have to be able to replay those events later and arrive at the  
same final state you did the first time.


So, in MACID, your events are *written* in the Update and Query monads.

To specific where an 'event' begins and ends, you register some of  
those functions with MACID using the mkMethods function. The event  
starts when a registered function is called, and ends when that  
function returns a value.


In order to be sure that the events can be replayed later and arrive  
at the same result, those events can not perform any IO, because the  
IO might result in a different answer when replayed.


So, to answer your question: You will not directly call functions in  
the Update monad. And you will not integrated the Update monad into  
your other monads. Instead you will register the Update and Query  
functions via mkMethods, and call them in the IO monad via query and  
update. That is likely to be fairly disruptive to your current design.  
But it ensures that every event is saved.


If you merely want periodic checkpoints, you can use happstack-data  
and just write the state out periodically.


hope this helps!

If I have still not answered your question, or you have others, feel  
free to ask!


- jeremy


On Nov 7, 2010, at 10:02 AM, Corentin Dupont wrote:


Hello Jeremy,
thanks for your mail.

I am in despair on this problem since days, I would really help your  
help.

I can't figure out how I can add MACID into my program.
Here's the problem:
I already have monads in my program like that:

> type Comm = StateT Communication IO
>
> type GameState a = StateT Game Comm a

Many functions make use of GameState.
The only type that need to be serialized is Game.
The type Communication contains TChans used for players communication.
The IO in Comm is necessary to make some print outs and to use an  
interpretor when needed (Hint).


How can this match with the Update type in Happstack?

Thanks a lot for your help.
Corentin


On Fri, Nov 5, 2010 at 3:50 AM, Jeremy Shaw   
wrote:

Hello,

I added a brief section to the happstack crash course on using MACID:

http://www.happstack.com/docs/crashcourse/HappstackState.html

That should hopefully get you started.

The example uses happstack state with happstack server. But there is
really no connection between the two.

Hope this helps! If you have additional questions, feel free to ask!

- j


On Thu, Nov 4, 2010 at 12:48 PM, Dupont Corentin
 wrote:
> Hello,
> I'm wondering how can I use Happstack's MACID in my application  
without

> breaking everything.
>
> I have a monad like that:
>
> type Comm = StateT Communication IO
>
> type GameState a = StateT Game Comm a
>
> and many functions like:
> foo :: GameState ()
> foo = do
>lift $ putComm 
>modify 
>
> The state of the game is stored in Game.
> Comm is used as an abstraction to communicate over several  
channels with

> players.
>
> Whereas MACID asks to use:
>
> type Update state = Ev (StateT state STM)
>
> How can I use this without modifying everything??
> I understand 

Re: [Haskell-cafe] Re: "Haskell is a scripting language inspired by Python."

2010-11-07 Thread Richard O'Keefe

On 5/11/2010, at 9:23 PM, Ketil Malde wrote:
>> Then there are algorithms that give
>> optimal results but blow up for anything much past 15 species, 
> 
> I.e, edit distance is O(n^k) for k sequences of length n.

I was actually referring to phylogeny reconstruction,
not edit distance.
> 
>> Then we turn to human designs, and suddenly THERE IS NO TREE.

Read what Guy Steel sad about the Fortress language; he refers
to about a dozen languages that influenced Fortress.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Bracket around every IO computation monad

2010-11-07 Thread Felipe Almeida Lessa
(I won't answer your main question, I'll just write some notes on your
current code.)

On Sun, Nov 7, 2010 at 10:40 PM, Mitar  wrote:
> neurons <- growNeurons [
>    do { a <- attach nerve1; return $ Growable a },
>    do { a <- attach nerve2; return $ Growable a },
>    do { a <- attach nerve3; return $ Growable a }
>  ]

Note that this is the same as

  neuros <- growNeurons [
Growable <$> attach nerve1,
Growable <$> attach nerve2,
Growable <$> attach nerve3]

> Types of attach and deattach are (if I simplify):
>
> attach :: Nerve n -> IO (LiveNeuron n)
> deattach :: LiveNeuron n -> IO ()
>
> Growable is only used so that I can put actions of different type in the list.

Well, you could use

  attachG :: Nerve n -> IO Growable
  attachG n = Growable <$> attach n

  ...
  neurons <- growNeurons [attachG nerve1, attachG nerve2, attachG nerve3]

Cheers,

-- 
Felipe.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Bracket around every IO computation monad

2010-11-07 Thread Mitar
Hi!

I have a class Neuron which has (among others) two functions: attach
and deattach. I would like to make a way to call a list/stack/bunch of
attach functions in a way that if any of those fail (by exception),
deattach for previously already attached values (called attach on
them) are deattached (called deattach on them).

I have come up with such way:

data Growable where
  Growable :: Neuron n => LiveNeuron n -> Growable

growNeurons :: [IO Growable] -> IO [Growable]
growNeurons attaches = growNeurons' attaches []
  where growNeurons' [] ls  = return ls
growNeurons' (a:ats) ls = bracketOnError a (\(Growable l) ->
deattach l) (\l -> growNeurons' ats (l:ls))

So I give growNeurons a list of attach actions and it returns a list
of attached values ((live)neurons). This works nice, but syntax to use
it is ugly:

neurons <- growNeurons [
do { a <- attach nerve1; return $ Growable a },
do { a <- attach nerve2; return $ Growable a },
do { a <- attach nerve3; return $ Growable a }
  ]

Types of attach and deattach are (if I simplify):

attach :: Nerve n -> IO (LiveNeuron n)
deattach :: LiveNeuron n -> IO ()

Growable is only used so that I can put actions of different type in the list.

It seems to me that all this could be wrapped into a monad. So that I
would be able to call something like:

neurons <- growNeurons' $ do
attach nerve1
attach nerve2
attach nerve3

Where I would be allowed to call actions of a special type class which
defined also clean-up function (in my case called deattach). And which
would be called if there was any exception thrown (and then at the end
rethrown). Otherwise, the result would be a list of all computed
values. In my case all this in IO monad.

So it is possible that evaluation of monad actions would be stacked
inside of bracketOnError and in a case of error clean-up functions
would be called, otherwise returns a list of results?


Mitar
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Compiler constraints in cabal

2010-11-07 Thread wren ng thornton

On 11/7/10 11:54 AM, Henning Thielemann wrote:

Awful - I would not like to complicate my Cabal files this way. This is
like copying the Build-Depends enumeration to all depending packages.


Oh, I agree :)

I wonder if you can include ghc in the build-tools: field and whether 
cabal-install bases its decisions on that field...


Another option might be to have users set the preference: field in 
~/.cabal/config. Though that requires user action again...


Why is the package ghc version specific anyways? Is it just a language 
extension thing?



Does the LanguageExtensions field prevent building a package, if the
installed compiler cannot handle that? I'm afraid, LanguageExtensions is
just a list of flags that is passed to GHC. But it sounds like a good
idea, if Cabal would also check, whether the used compiler supports the
required LanguageExtensions at all.


If you just wanted to ensure that things don't build on the wrong 
version, then you could always use a custom Setup.hs and use CPP to 
choose between exitSuccess and exitFailure somewhere along the way.


--
Live well,
~wren
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: internship opportunities in France

2010-11-07 Thread Lee Pike
Hi,

On a (possibly-related) note: Galois, Inc. and the National Institute of 
Aerospace (NIA) will likely be hosting a Visiting Scholar this summer for a 
joint NASA-sponsored project, located in Virginia, on the East coast of the 
U.S.  (Since this particular opportunity is a visiting scholar position, we pay 
all travel/living expenses, but no salary, so one does not need a visa/work 
permit to work in the U.S.)

We had two visiting scholars last summer, from Germany and France respectively, 
publishing a paper and even flying some aircraft 
.
  The project is a Haskell DSL project focused on monitoring embedded systems.

Interested folks can contact Alwyn Goodloe (Cc'ed) at the NIA and myself, off 
the list.

Regards,
Lee

> Hello folks !
> I am a Computer Science student looking for an internship of 6 months here
> in France. Does anybody know of any company working with Haskell ?
> Thanks in advance :D,
> 
> Lorenzo Fundaró García

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: hmatrix's fitModel function crashes ghc(i)

2010-11-07 Thread Roel van Dijk
Cool, this means hmatrix is still an option for my fitting problem.
The problem is a bit annoying but I can work with it.

My assumption about the cause of the problem (wrong number of
arguments) made me miss the real problem.

Thanks for the explanation.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Compiler constraints in cabal

2010-11-07 Thread Henning Thielemann
wren ng thornton schrieb:
> On 11/6/10 6:20 AM, Reiner Pope wrote:
>> I was aware of this condition, but I'm not precisely sure it addresses
>> my requirements. When you run "cabal install some-package", cabal
>> reads all version constraints listed in the "build-depends" field, and
>> chooses which versions of which packages to download from Hackage in
>> order to satisfy these constraints.
>>
>> I want to expose my dependency on a particular version of ghc to
>> cabal's constraint satisfier. The end result I want is that when you
>> type "cabal install hmatrix-static" with ghc-6.12 installed, then
>> cabal chooses hmatrix-static-0.3; and when you type "cabal install
>> hmatrix-static" with ghc-7.0 installed, then cabal chooses
>> hmatrix-static-0.4.
> 
> 
> Clients of hmatrix-static would have to say
> 
> if impl(ghc >= 7.0)
> Build-Depends: hmatrix-static == 0.4.*
> else
> Build-Depends: hmatrix-static == 0.3.*
> 
> in order to pull in the right dependency for themselves.

Awful - I would not like to complicate my Cabal files this way. This is
like copying the Build-Depends enumeration to all depending packages.

> In order to get the behavior you're after, though, is trickier business.
> Since every version of GHC ships with a different version of base,
> you'll have to make use of that knowledge such that users of ghc-7.0
> with base-5 will get hmatrix-static-0.4 whereas users of ghc-6.12 with
> base-4 will get hmatrix-static-0.3

I would not like this solution, too, since this assumes, that 'base' is
a GHC-specific library and I hope this will be no longer true in the future.

Does the LanguageExtensions field prevent building a package, if the
installed compiler cannot handle that? I'm afraid, LanguageExtensions is
just a list of flags that is passed to GHC. But it sounds like a good
idea, if Cabal would also check, whether the used compiler supports the
required LanguageExtensions at all.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How can I use MACID in my existing application?

2010-11-07 Thread Corentin Dupont
Hello Jeremy,
thanks for your mail.

I am in despair on this problem since days, I would really help your help.
I can't figure out how I can add MACID into my program.
Here's the problem:
I already have monads in my program like that:

> type Comm = StateT Communication IO
>
> type GameState a = StateT Game Comm a

Many functions make use of GameState.
The only type that need to be serialized is Game.
The type Communication contains TChans used for players communication.
The IO in Comm is necessary to make some print outs and to use an
interpretor when needed (Hint).

How can this match with the Update type in Happstack?

Thanks a lot for your help.
Corentin


On Fri, Nov 5, 2010 at 3:50 AM, Jeremy Shaw  wrote:

> Hello,
>
> I added a brief section to the happstack crash course on using MACID:
>
> http://www.happstack.com/docs/crashcourse/HappstackState.html
>
> That should hopefully get you started.
>
> The example uses happstack state with happstack server. But there is
> really no connection between the two.
>
> Hope this helps! If you have additional questions, feel free to ask!
>
> - j
>
>
> On Thu, Nov 4, 2010 at 12:48 PM, Dupont Corentin
>  wrote:
> > Hello,
> > I'm wondering how can I use Happstack's MACID in my application without
> > breaking everything.
> >
> > I have a monad like that:
> >
> > type Comm = StateT Communication IO
> >
> > type GameState a = StateT Game Comm a
> >
> > and many functions like:
> > foo :: GameState ()
> > foo = do
> >lift $ putComm 
> >modify 
> >
> > The state of the game is stored in Game.
> > Comm is used as an abstraction to communicate over several channels with
> > players.
> >
> > Whereas MACID asks to use:
> >
> > type Update state = Ev (StateT state STM)
> >
> > How can I use this without modifying everything??
> > I understand that MACID must record the  from above but the
> > message should not.
> >
> > Thanks for help!
> >
> > Corentin
> >
> >
> >
> >
> > ___
> > Haskell-Cafe mailing list
> > Haskell-Cafe@haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
> >
> >
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANNOUNCE: arrow-list. List arrows for Haskell.

2010-11-07 Thread Sebastian Fischer
I'm planning to write up a blog post about using list arrows for XML  
processing.


Ok, I'll say tuned! Maybe a smaller example for the Haddock docs needs  
less time.


Maybe this sounds weird on the Haskell mailing list, but at Silk[1]  
we have a full implementation of (functional reactive) list arrows  
in JavaScript. The arrows build up an AST of operations that we  
statically optimize to a more efficient form. This is needed because  
JavaScript itself is not going to fuse intermediate list for you.


I'm reinventing all of this in Haskell now to gain more insight in  
what we've actually done in JavaScript. :-)


Sounds more interesting than weird to me. In case you blog about that  
too, I'll probably read it. I'm interested to get an intuition what  
you can do with arrows and what not. An intuition that goes beyond the  
quite abstract "you can't choose different computation paths based on  
the result of a computation". Can you, for example, define a `perm`  
arrow that yields every permutation of it's input? Monadic  
implementations look like they need `>>=` but there may be another  
way.. Maybe you now have an example for the docs ;o)


I'm also planning to investigate whether it is possible (useful) to  
perform the list computations (the map in concatMap) in parallel.  
I'm not sure if someone has already tried this for list monads.


I tried something similar a while ago (for monads):





Sebastian

P.S.

In


[1] https://blog.silkapp.com/2009/12/reinventing-xslt-in-pure-javascript/


there are two occurrences of the `sum` function which should probably  
be `alt` instead.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANNOUNCE: arrow-list. List arrows for Haskell.

2010-11-07 Thread Sebastiaan Visser
On Nov 7, 2010, at 1:40 AM, Sebastian Fischer wrote:
> On Nov 6, 2010, at 10:00 PM, Sebastiaan Visser wrote:
> 
>> List arrows are a powerful tool when processing XML, building query 
>> languages and lots of other domains that build on functions that might 
>> return more than one value as their output.
> 
> Interesting. Do you plan to write some examples that show
> 
>  * how to use ListArrows,

Yes, I certainly am. Although, time is currently not on my side. I'm planning 
to write up a blog post about using list arrows for XML processing.

>  * differences to using the list monad, and
>  * when using ListArrow is preferrable?

Currently I'm playing with the idea of a translation of XML list arrows in 
Haskell to DOM operations in JavaScript. The lack of ArrowApply (the full power 
of monads) allows you to inspect your computations, this makes translations to 
other languages possible.

> I'm interested to see something like this worked out although I have some 
> rough ideas like "monads are more powerful and arrows may allow stronger 
> reasoning and more efficient implementations". Can you substantiate these 
> general points for the concrete case of ListArrow vs list monad?

Beside the fact that, after playing with them for while, I find arrows more 
convenient to use than monads, the ability to inspect their structure can help 
you to optimize them.

Maybe this sounds weird on the Haskell mailing list, but at Silk[1] we have a 
full implementation of (functional reactive) list arrows in JavaScript. The 
arrows build up an AST of operations that we statically optimize to a more 
efficient form. This is needed because JavaScript itself is not going to fuse 
intermediate list for you.

I'm reinventing all of this in Haskell now to gain more insight in what we've 
actually done in JavaScript. :-)

> I assume your implementation is *not* more efficient than the list monad as 
> it builds on ListT.

That is entirely true.

But this is only implementation, different implementations may be possible that 
are more efficient. As long as ArrowApply is not involved static optimization 
might be possible that fuses intermediate lists, as far as the compiler is not 
already doing so. 

I'm also planning to investigate whether it is possible (useful) to perform the 
list computations (the map in concatMap) in parallel. I'm not sure if someone 
has already tried this for list monads.

> Sebastian

Sebastiaan

[1] https://blog.silkapp.com/2009/12/reinventing-xslt-in-pure-javascript/

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANNOUNCE: language-cil

2010-11-07 Thread Tom Lokhorst
Hi all,

I've just uploaded language-cil [1], a library for manipulating a
Common Intermediate Language (CIL) [2]. CIL is the lowest level
language used by Microsoft .NET and Mono on Mac an Linux.

With language-cil, you can construct an AST and pretty print it to
concrete syntax. The assembler `ilasm`, can create a .exe file which
can be run by Mono or .NET.

The package is not finished, it only supports a subset of the full
language, but it's already usable. For more information, as well as an
example to quickly get started, see the github page [3].


Cheers,
Tom Lokhorst

[1]: http://hackage.haskell.org/package/language-cil
[2]: http://en.wikipedia.org/wiki/Common_Intermediate_Language
[3]: https://github.com/tomlokhorst/language-cil#readme
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Fwd: [Haskell-cafe] DSL libraries

2010-11-07 Thread steffen
Hey,

Sorry, hard week and I haven't had time to look into it until now. I
remember having had the very same Problem with AwesomePrelude. A very
quick fix for me was to remove the "Lang.*" and "Compiler.*" entries
in "exposed-modules" in the cabal file. You won't really need them
anyway.

If you really want to try AwesomePrelude, you may find the need to
changes some parts of it. For example, the AwesomePrelude's Num class
implies a Show instance, which can be very annoying. So best is to use
it as base for your own code and steal from it what you will need or
create your own version of AwesomePrelude according to your own
needs.

For example calling "test" in this example[1] will print out "num" and
when defining your own Show-Instance your program won't compile due to
overlapping instances.

The same example using AwesomePrelude with associated data families[2]
introducing new types for every aspect of your DSL  will look like [3]
(See the Lang.* Modules for more examples and evaluation, for this
kind of type safe DSL).

[1] https://gist.github.com/666119
[2] https://github.com/urso/AwesomePrelude
[3] https://gist.github.com/666121

On 4 Nov., 18:51, Dupont Corentin  wrote:
> Nobody had the compilation messages I had?
>
>
>
>
>
>
>
> -- Forwarded message --
> From: Dupont Corentin 
> Date: Tue, Nov 2, 2010 at 2:30 PM
> Subject: [Haskell-cafe] DSL libraries (Was: Map constructor in a DSL)
> To: steffen , haskell-c...@haskell.org
>
> Hello Steffen,
> can you compile AwesomePrelude?
> I've got error messages (see below).
>
> By the way, I've looked at some DSLs made in Haskell, if I don't mistake
> there are lots of similarities between them.
> There similarities could be put in a library to help the implementors of a
> DSL, more or less like AwesomePrelude.
>
> Is there already packages on Hackage dealing with that?
>
> Cheers,
> Corentin
>
> AwesomePrelude compilation error:
> I'm using GHC 6.12.1.
>
> > cd tomlokhorst-AwesomePrelude-9819315
> > cabal install
> (...)
> Warning: Lang.Haskell: Instances of type and data families are not yet
> supported. Instances of the following families will be filtered out:  H
>
> Then, when trying with a very simple GATD in GHCI, I've got:
>
> : HSAwesomePrelude-0.1.0.o: unknown symbol
> `AwesomePreludezm0zi1zi0_
> CompilerziLiftDefinitions_inline_closure'
> ghc: unable to load package `AwesomePrelude-0.1.0'
>
> On Thu, Oct 28, 2010 at 2:02 PM, steffen 
> wrote:
>
> > I think you would love to have a look at AwesomePrelude[1] or a fork
> > of AwesomePrelude using associated types[2]
> > Some more background information by Tom Lokhorst [3][4].
>
> > [1]http://github.com/tomlokhorst/AwesomePrelude
> > [2]http://github.com/urso/AwesomePrelude
> > [3]http://tom.lokhorst.eu/2009/09/deeply-embedded-dsls
> > [4]http://tom.lokhorst.eu/2010/02/awesomeprelude-presentation-video
>
> > On 28 Okt., 12:09, Dupont Corentin  wrote:
> > > Thank you for your rich responses.
>
> > > Indeed I think I miss some thinks in my DSL, that would make things
> > easier
> > > to deal with lists and first class functions.
> > > I don't really know what for now.
> > > Perhaps a List Constructor? Or a constructor on functions like yours
> > Ryan?
> > > EAp :: Exp ref (a -> b) -> Exp ref a -> Exp ref b
> > > It's from which DSL? It is accessible on the net?
>
> > > Chris suggested me that I can only define the Foldr constructor and
> > deduce
> > > Map from it.
> > > But maybe I have to add a List constructor for that.
>
> > > But in the suggestions from Ryan and Brandon I don't understand why I
> > should
> > > add an extra type parameter and what it is!
>
> > > Steffen: Wow nice. I'll integrate that ;)
>
> > > I'm also looking at the Atom's DSL to get inspiration.
> > > Something I don't understand in it is that it has two languages, on
> > typed:
>
> > > data E a where
> > >   VRef    :: V a -> E a
> > >   Const   :: a -> E a
> > >   Cast    :: (NumE a, NumE b) => E a -> E b
> > >   Add     :: NumE a => E a -> E a -> E a
> > > etc.
>
> > > And, along with it, an untyped counterpart:
>
> > > -- | An untyped term.
> > > data UE
> > >   = UVRef UV
> > >   | UConst Const
> > >   | UCast  Type UE
> > >   | UAdd   UE UE
> > > etc.
>
> > > What that for? What's the use of having beautiful GADT if you have to
> > > maintain an untyped ADT aside??
>
> > > Corentin
>
> > > ___
> > > Haskell-Cafe mailing list
> > > haskell-c...@haskell.orghttp://
> >www.haskell.org/mailman/listinfo/haskell-cafe
> > ___
> > Haskell-Cafe mailing list
> > haskell-c...@haskell.org
> >http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
>
> ___
> Haskell-Cafe mailing list
> haskell-c...@haskell.orghttp://www.haskell.org/mailman/listinfo/haskell-cafe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listi