[Haskell-cafe] Using syntactic to implement the lambda calculus

2012-07-03 Thread Alex Rozenshteyn
(This is intended as a simplification of the problem I actually need to solve.) I'm trying to implement the lambda calculus (with CBV evaluation) using the syntactic package, in such a way that a simple extension is also simple to implement. I am stuck on the fact that it seems that the Value

[Haskell-cafe] Using Data Types a la Carte

2012-04-19 Thread Alex Rozenshteyn
I'm trying to implement a set of languages with a large overlap between them. From what I understand, there are 3 main ways to do this: Finally Tagless, Data Types a la Carte, or manually. I'm currently leaning toward DTalaC, but not strongly. There seem to be two packages which implement the

[Haskell-cafe] Is there a DFA library?

2011-10-07 Thread Alex Rozenshteyn
I couldn't find one on hackage that isn't better described as a RegEx library. I'm looking for things like minimization, completion, etc. kinda like http://www.cis.upenn.edu/~cis639/docs/xfst.html However, I may have just missed it. -- Alex R

Re: [Haskell-cafe] yi + cabal-dev

2011-06-22 Thread Alex Rozenshteyn
From looking at Yi's code, there seems to be a hard-coded list of arguments to pass to ghc. A hack would be to recompile Yi with the arguments to use a different package database... On Wed, Jun 22, 2011 at 2:32 AM, Rogan Creswick cresw...@gmail.com wrote: On Tue, Jun 21, 2011 at 6:55 PM, Alex

Re: [Haskell-cafe] yi + cabal-dev

2011-06-22 Thread Alex Rozenshteyn
differently. While amusing, I'd rather not. On Wed, Jun 22, 2011 at 3:42 AM, Rogan Creswick cresw...@gmail.com wrote: On Tue, Jun 21, 2011 at 11:59 PM, Alex Rozenshteyn rpglove...@gmail.com wrote: From looking at Yi's code, there seems to be a hard-coded list of arguments to pass to ghc. A hack

[Haskell-cafe] yi + cabal-dev

2011-06-21 Thread Alex Rozenshteyn
I'm trying to run yi. More precisely, I'm trying to run yi in its own sandbox, created by cabal-dev. yi uses dyre to recompile its config file. Unsurprisingly, this fails, since ghc doesn't know anything about the yi install unless pointed to a separate package database. Has anyone gotten a

Re: [Haskell-cafe] Category theory as a design tool

2011-06-21 Thread Alex Rozenshteyn
Funny, I didn't hear anyone say Candlejack. What abou ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Erlang's module discussion

2011-05-28 Thread Alex Rozenshteyn
Since no-one has yet mentioned it, and I think it might be relevant, http://types.bu.edu/seminar-modularity/first-class-modules-for-haskell.pdf I haven't read it with any degree of understanding, but I don't think it's tractable to remove modules from haskell, nor desirable. On Sat, May 28, 2011

Re: [Haskell-cafe] Parsing Haskell in Parsec

2011-03-21 Thread Alex Rozenshteyn
Thank you, everyone, for the suggestions. On Mon, Mar 21, 2011 at 12:28 PM, Johannes Waldmann waldm...@imn.htwk-leipzig.de wrote: Alex Rozenshteyn rpglover64 at gmail.com writes: as part of a larger project of porting http://www.cs.jhu.edu/~scott/pl/book/dist/ from ocaml to Haskell

[Haskell-cafe] Parsing Haskell in Parsec

2011-03-19 Thread Alex Rozenshteyn
I'm trying to write a parser for a small functional language in Parsec, as part of a larger project of porting thishttp://www.cs.jhu.edu/%7Escott/pl/book/dist/from ocaml to Haskell. I was wondering if there was a parser for Haskell written in Parsec that I could use as a reference. --

Re: [Haskell-cafe] parsing exercise

2011-01-22 Thread Alex Rozenshteyn
You might want to check out parsec, and the chapter related to it in RWH. http://book.realworldhaskell.org/read/using-parsec.html On Sun, Jan 23, 2011 at 12:09 AM, Sebastian Fischer fisc...@nii.ac.jpwrote: Hello, I need a function and wonder whether I can copy some existing code so I don't

Re: [Haskell-cafe] What's the best seed for random API ?

2011-01-05 Thread Alex Rozenshteyn
Admittedly, I don't know much about this from the haskell end or about the particular api. If you want statistical randomness, your seed doesn't matter; just the PRNG. I might even have seeded with a constant or taken the seed from the user. Seeding from urandom will make your output more

Re: [Haskell-cafe] Question about TagSoup

2010-12-03 Thread Alex Rozenshteyn
I really wouldn't use tag soup for this. Haskell has libraries specifically for XML processing which might be better suited to your needs. On Fri, Dec 3, 2010 at 5:59 AM, David Virebayre dav.vire+hask...@gmail.comdav.vire%2bhask...@gmail.com wrote: Hello café, I have seen tutorials about

Re: [Haskell-cafe] Layered maps

2010-10-09 Thread Alex Rozenshteyn
This came up as I was doing homework for natural language processing. I'm constructing a trigram model from training data, but I also need the bigram and unigram counts. I could, for each triple of characters, add the 3 tuple to a trigram map and increment its count (I know I'm not actually

Re: [Haskell-cafe] Layered maps

2010-10-09 Thread Alex Rozenshteyn
Hmm. It seems that both the trie packages I found just provide a standard map-like interface, without exposing their trie-ness. Makes sense, but limits usefulness for me. Thanks. On Sat, Oct 9, 2010 at 3:08 PM, Jake McArthur jake.mcart...@gmail.comwrote: What you describe sounds like a

[Haskell-cafe] Layered maps

2010-10-08 Thread Alex Rozenshteyn
Does there exist a library which allows me to have maps whose elements are maps whose elements ... with a convenient syntax. Alternatively, does there exist a library like Data.Tree where forests are sets rather than lists? -- Alex R ___

[Haskell-cafe] Memoization/call-by-need

2010-09-15 Thread Alex Rozenshteyn
I feel that there is something that I don't understand completely: I have been told that Haskell does not memoize function call, e.g. slowFib 50 will run just as slowly each time it is called. However, I have read that Haskell has call-by-need semantics, which were described as lazy evaluation

Re: [Haskell-cafe] random-fu confusion

2010-09-07 Thread Alex Rozenshteyn
it took so long responding. -- James On Sep 2, 2010, at 10:01 AM, Alex Rozenshteyn wrote: I seem to be having confusion at the runRVar level of random-fu. I can't figure out how to use the Data.Random.Source.PureMT module to get a meaningful random source (I can't get my code to type-check

[Haskell-cafe] random-fu confusion

2010-09-02 Thread Alex Rozenshteyn
I seem to be having confusion at the runRVar level of random-fu. I can't figure out how to use the Data.Random.Source.PureMT module to get a meaningful random source (I can't get my code to type-check). I wrote a [trivial] flipCoin function flipCoin = uniform False True and am trying to fill in

[Haskell-cafe] Partial Signatures with Implicit Parameters

2010-08-30 Thread Alex Rozenshteyn
I would like to specify that a function takes implicit parameters, without specifying its full return type. My main motivation for this is my xmonad config file and the attempt to remove the need for NoMonomorphismRestriction and some of the code smell associated with global variables that wafts

Re: [Haskell-cafe] Deprecated gtk2hs functions

2010-08-16 Thread Alex Rozenshteyn
comments? andrew On Fri, 2010-07-16 at 17:44 -0400, Alex Rozenshteyn wrote: More like buttonActivated [1]. Has it been decided that button-specific events are going to be deprecated in favor of their general widget equivalents, with buttonActivated being an (IMO) awkward title

Re: [Haskell-cafe] Can we come out of a monad?

2010-07-30 Thread Alex Rozenshteyn
Here is my understanding with respect to the question. In the general case, you cannot come out of a monad, because the monad typeclass does not include any functions without of the form (m a - a). Also, as a category theoretic construct, a monad does not have to have an exit function. (caveat:

[Haskell-cafe] Deprecated gtk2hs functions

2010-07-16 Thread Alex Rozenshteyn
I recently started playing around with gtk2hs. I noticed that `onClicked`, `afterClicked`, etc. functions have been deprecated, presumably in favor of the `on` and `after` functions in the Glib signals module, but I couldn't find a collection of the appropriate signals to replace the

Re: [Haskell-cafe] Deprecated gtk2hs functions

2010-07-16 Thread Alex Rozenshteyn
/Graphics-UI-Gtk-Abstract-Widget.html#v%3AexposeEvent On Fri, Jul 16, 2010 at 11:36 AM, Alex Rozenshteyn rpglove...@gmail.com wrote: I recently started playing around with gtk2hs. I noticed that `onClicked`, `afterClicked`, etc. functions have been deprecated, presumably in favor

Re: [Haskell-cafe] Haskell on Debian

2010-04-05 Thread Alex Rozenshteyn
Anyone? On Wed, Mar 31, 2010 at 9:18 PM, Alex Rozenshteyn rpglove...@gmail.comwrote: $ ghc-pkg check outputs nothing $ ghc-pkg list unix /var/lib/ghc-6.12.1/package.conf.d unix-2.4.0.0 /home/alex/.ghc/x86_64-linux-6.12.1/package.conf.d unix appears to be in the build-depends

Re: [Haskell-cafe] Haskell on Debian

2010-04-05 Thread Alex Rozenshteyn
phase. The exception was: ExitFailure 1 On Mon, Apr 5, 2010 at 11:25 AM, Daniel Fischer daniel.is.fisc...@web.dewrote: Am Montag 05 April 2010 17:19:35 schrieb Alex Rozenshteyn: Anyone? base isn't listed among the build-depends of the executable, so the obvious thing is to add base to the build

[Haskell-cafe] True Random Numbers

2010-04-03 Thread Alex Rozenshteyn
Does haskell have a way of using /dev/random to generate random *things*? Currently I'm just reading the data into a byte string, converting it into bits, and keeping track of it in the state monad. -- Alex R ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: True Random Numbers

2010-04-03 Thread Alex Rozenshteyn
The Rand monad you linked seems to be a step in the right direction for what I want, but it uses getStdGen, which appears to end up using cpu time to seed the generator. On Sat, Apr 3, 2010 at 9:21 AM, Ertugrul Soeylemez e...@ertes.de wrote: Matthew Hayden mrehay...@googlemail.com wrote:

Re: [Haskell-cafe] Re: True Random Numbers

2010-04-03 Thread Alex Rozenshteyn
Looking over the random-fu package, I think it might have what I'm looking for (and a lot that I'm not). On Sat, Apr 3, 2010 at 6:27 PM, Gökhan San g...@stillpsycho.net wrote: Alex Rozenshteyn rpglove...@gmail.com writes: The Rand monad you linked seems to be a step in the right direction

[Haskell-cafe] Haskell on Debian

2010-03-31 Thread Alex Rozenshteyn
I tend to install haskell packages from apt whenever possible. One such package is unix, which appears to come provided by the ghc6 debian package. I'm trying to cabal install lambdabot and getting the following: $ cabal install lambdabot Resolving dependencies... Configuring

Re: [Haskell-cafe] Haskell on Debian

2010-03-31 Thread Alex Rozenshteyn
-depends appears to fix the error (but now it complains that base is hidden). On Wed, Mar 31, 2010 at 8:48 PM, Ivan Miljenovic ivan.miljeno...@gmail.comwrote: On 1 April 2010 11:42, Alex Rozenshteyn rpglove...@gmail.com wrote: Main.hs:11:7: Could not find module `System.Posix.Signals

Re: [Haskell-cafe] existentially quantified data types - restrictions

2010-03-25 Thread Alex Rozenshteyn
I think type witnesses *might* be relevant to your interests. On Thu, Mar 25, 2010 at 11:13 AM, andy morris a...@adradh.org.uk wrote: Can you have Typeable as an extra constraint? If so: {-# LANGUAGE ExistentialQuantification #-} import Data.Typeable data Baz = forall a. (Eq a,