You probably don't need recursion in the DSL for this (that would
require a way to detect cycles in the expressions). For this example, it
looks like all you need is to add something like `map` as a DSL construct.
Your example could perhaps be expressed as
forEach (1,1000) (\n - out
I'm happy to hear your approval.
I've spent some time yesterday cleaning up the code and writing down all things
that do not work.
The list I made is avaliable on github:
https://github.com/killy/lambdabot/issues
There are 17 open issues at the moment and I know I will not have enough
Hi Joerg,
You might find Abstract Syntax Graphs for Domain Specific Languages by
Bruno Oliveira and Andres Löh (
http://ropas.snu.ac.kr/~bruno/papers/ASGDSL.pdf) a helpful reference to
adding things like recursion (and other binding constructs) to your DSL.
Edsko
On Tue, Feb 19, 2013 at 9:47
I'm glad to announce the package for Common subexpression elimination [1].
It's an implementation of the hashconsig algorithm as described in the
paper
'Implementing Explicit and Finding Implicit Sharing in EDSLs' by Oleg
Kiselyov.
Main point of the library is to define this algorithm in the most
Ryan Newton rrnew...@gmail.com wrote:
My problem is that I can't create a type representing what I want at
the Haskell type-check time, and I need such a type for either
casting or a foreign import. For example, let's say the function
takes a number of Int arguments between 1 and 1000. If I
Twan van Laarhoven twanvl at gmail.com writes:
After taking a peek at the documentation: have you considered removing
the size function from Grid?
. . .
It might also be useful to add a rectangular grid type where diagonally
adjacent cells are also neighbors.
. . .
Another interesting idea
2013-02-19 12:10, Anton Kholomiov skrev:
I'm glad to announce the package for Commonsubexpression elimination [1].
It's an implementation of the hashconsig algorithm as described in the
paper
'Implementing Explicit and Finding Implicit Sharing in EDSLs' by Oleg
Kiselyov.
Main point of the
On Mon, 18 Feb 2013 18:48:01 +0100, Daniel Trstenjak
daniel.trsten...@gmail.com wrote:
Hi all,
also if there's not that much to see and only a few minutes of gameplay,
but after spending quite a few hours writing it, getting a feeling for
Haskell and it's usage, perhaps it's in some way
Hi Henk-Jan,
It seems to me that there is something missing from this e-mail.
What are you missing?
Greetings,
Daniel
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
There are several packages that already define fixpoints (another one is
about unification), but all packages that I'm aware of define a lot of
functionality
that I don't need (and actually don't understand, packages with fixpoint
types
tend to be rather dense with math). I'd like it to be simple
2013/2/19 Daniel Trstenjak daniel.trsten...@gmail.com:
Hi Henk-Jan,
It seems to me that there is something missing from this e-mail.
What are you missing?
Screenshots obviously ;)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Fully understandable! Compdata would be quite a heavy dependency for
your library.
I'm just generally fond of the idea of collecting all DSL implementation
tricks under one umbrella. That requires using the same term representation.
/ Emil
2013-02-19 14:12, Anton Kholomiov skrev:
There are
On Tue, Feb 19, 2013 at 02:15:33PM +0100, Vo Minh Thu wrote:
Screenshots obviously ;)
Hurray!
attachment: layers.png___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On 19/02/13 13:39, Daniel Trstenjak wrote:
On Tue, Feb 19, 2013 at 02:15:33PM +0100, Vo Minh Thu wrote:
Screenshots obviously ;)
Hurray!
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
In C usual way is to set some bit in integer variable by shifting or oring,and
than check flag integer variable by anding with particular flag value.What is
Haskell way?
Thanks. ___
Haskell-Cafe mailing list
The same as C way. You can import Data.Bits and can use the functions.
Prelude import Data.Bits
Prelude Data.Bits Data.Bits.
Data.Bits... Data.Bits.bitDefault Data.Bits.complementBit
Data.Bits.rotate Data.Bits.shift
Data.Bits.testBitDefault
Data.Bits..|.Data.Bits.bitSize
For what it's worth, I also have a fork of lambdabot[1] I've been using for
quite a while now, which may provide a cleaner starting point. In particular,
it updates the plugin and command API to be (IMO) quite a bit cleaner and
easier to use and understand. It could probably use some
Quoth Branimir Maksimovic bm...@hotmail.com,
In C usual way is to set some bit in integer variable by shifting or oring,
and than check flag integer variable by anding with particular flag value.
What is Haskell way?
Of course you may do the very same thing, if you like. I think if
there's
On Tue, Feb 19, 2013 at 10:11 AM, Branimir Maksimovic bm...@hotmail.comwrote:
In C usual way is to set some bit in integer variable by shifting or
oring,
and than check flag integer variable by anding with particular flag value.
What is Haskell way?
You can do that, but a somewhat more
On Tue, 19 Feb 2013 13:55:14 +0100, Daniel Trstenjak
daniel.trsten...@gmail.com wrote:
Hi Henk-Jan,
It seems to me that there is something missing from this e-mail.
What are you missing?
The message starts with the word also, so it looks if there should be
some other text in front of
Tristan, Please let me know how this works out for you. I was struggling with
something similar over the last few days. It's expressed in these 2 S.O.
questions. In my case I'm going to probably just move on and stick with a
standard ADT for now. It was interesting to explore the possibilities
Wow, this indeed looks like a nice starting point, though I can't build
lambdabot from your repo -
seems that dice package is not on Hackage. Is this the package that you rely on:
https://github.com/serialhex/dice ?
Anyway, how would you feel about changes that I would like to make:
- move all
Sorry, I uploaded it this morning since I knew it wasn't there (it's the dice
repo from my github account, mokus0). Have you run cabal update in the last
4 or 5 hours?
On Feb 19, 2013, at 2:36 PM, Jan Stolarek jan.stola...@p.lodz.pl wrote:
Wow, this indeed looks like a nice starting point,
On Tue, Feb 19, 2013 at 5:36 PM, Jan Stolarek jan.stola...@p.lodz.pl wrote:
- remove unlambda, brainfuck and show from the repo. They are on hackage, no
need to keep them
here - these packages aren't even used in the build process.
Where will they go?
--
gwern
http://www.gwern.net
On Feb 19, 2013, at 2:36 PM, Jan Stolarek jan.stola...@p.lodz.pl wrote:
Anyway, how would you feel about changes that I would like to make:
- move all modules into Lambdabot. namespace
- remove unlambda, brainfuck and show from the repo. They are on hackage, no
need to keep them
here -
I have been trying to create a parser for a functional programming
language, but there is no need to create an AST but merely check that the
code is valid according to the grammar.
In the following tutorial I have been trying to take some pointers from,
data declarations are used to create an AST
If all you want to do is check that the code is valid (i.e., you aren't
going to interpret the code), you can just return a Bool. If you want to
interpret it, but don't want to have a Stmt type, you can return IO ()
actions. In that case, the parser's type will be
Parser (IO ())
I think an
Come to think of it, a parsec parser already wraps over Either, so if all
you want to do is check if a result is valid, you can abuse the Either
semantics so that your type is:
Parser () -- the parser which returns nothing on success or an error on
failure.
On Tue, Feb 19, 2013 at 3:20 PM,
Brandon Allbery allber...@gmail.com wrote:
In C usual way is to set some bit in integer variable by shifting or
oring, and than check flag integer variable by anding with
particular flag value. What is Haskell way?
You can do that, but a somewhat more idiomatic way would be a list
(or,
I am glad to announce a new major release of SmallCheck,
a property-based testing library for Haskell.
The major changes in this release are documented here:
http://ro-che.info/articles/2013-02-19-smallcheck.html
Roman
___
Haskell-Cafe mailing list
What a delightfully elegant approach to CSE! I've been thinking about CSE
for DSELs and about functor fixpoints, but it never occurred to me to put
the two together.
Do you think the approach can be extended for non-regular (nested)
algebraic types (where the recursive data type is sometimes at a
That said, to express foldl via foldr, we need a higher-order
fold. There are various problems with higher-order folds, related to
the cost of building closures. The problems are especially severe
in strict languages or strict contexts. Indeed,
foldl_via_foldr f z l = foldr (\e a z
Do you think the approach can be extended for non-regular (nested)
algebraic types (where the recursive data type is sometimes at a different
type instance)? For instance, it's very handy to use GADTs to capture
embedded language types in host language (Haskell) types, which leads to
On Tue, Feb 19, 2013 at 3:01 PM, James Cook mo...@deepbondi.net wrote:
On Feb 19, 2013, at 2:36 PM, Jan Stolarek jan.stola...@p.lodz.pl wrote:
Anyway, how would you feel about changes that I would like to make:
- move all modules into Lambdabot. namespace
- remove unlambda, brainfuck and
Dnia wtorek, 19 lutego 2013, Gwern Branwen napisał:
On Tue, Feb 19, 2013 at 5:36 PM, Jan Stolarek jan.stola...@p.lodz.pl wrote:
- remove unlambda, brainfuck and show from the repo. They are on hackage,
no need to keep them here - these packages aren't even used in the build
process.
Where
Hello all,
this was previously asked on haskell-beginners, but only partially answered.
As an exercise I am writing a parser roughly following the expamples in Graham
Hutton's book. The language contains things like:
data Exp = Lit Int -- literal integer
| Plus Exp Exp
My naive
I have no objections to any of these,
Great. Then I will start making mentioned changes and sending pull requests
when I find some free
time.
though I would recommend as Gwern
hinted that if related packages are to be removed that they should also be
given new homes - I believe that the
* Martin Drautzburg martin.drautzb...@web.de [2013-02-20 08:13:16+0100]
I do know for sure, that it is possible to parse (1+2)+3 (ghci does it just
fine). But I seem to be missing a trick.
Can anyone shed some light on this?
The trick in this case is that ghci doesn't use a recursive
38 matches
Mail list logo