News aggregator

ANN: treeviz-0.0.4 - a tool for visualizingDivide&Conquer computational breakdown.

haskell-cafe - Tue, 12/31/2013 - 12:57am
I just posted v0.0.4 of treeviz, a Haskell package for visualizing how various divide & conquer algorithms break down computations. The specific example provided is the classic fast Fourier transform (FFT). http://hackage.haskell.org/package/treeviz-0.0.4 https://github.com/capn-freako/treeviz Happy holidays, -db _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Question on nested State monads.

haskell-cafe - Sun, 12/29/2013 - 4:24am
Hi all, If I want to use a second, nested State monad inside another State monad, must I thread the outer monad’s state through the processing of the inner one, even if the inner one falls out of scope before I return from the processing body of the outer one? Thanks, -db
Categories: Offsite Discussion

Name for the following combinators?

haskell-cafe - Sat, 12/28/2013 - 5:47pm
Dear all, Recently I have found myself using these two combinators a lot: http://lpaste.net/97643 They basically allow composition of any m satisfying (Monad m, Traversable m). I have been thinking about moving them to a separate package and giving them better names (in the original paper, they are simply called join and bind). Does anyone have a better suggestion for the name of the package, module and the two combinators? Should they be called joinDefault, or simply called join and bind to be imported with a qualifier? This might be a bicycle-shed question, but I tend to find stylistic questions important when it comes to improving clarity and readability. Best wishes, Hans
Categories: Offsite Discussion

Segmentation fault/access violation when CPLUS_INCLUDE_PATH not set correctly

haskell-cafe - Sat, 12/28/2013 - 3:30pm
L.S., When I compile an application against an experimental version of wxHaskell*, the application always ends with the message: Segmentation fault/access violation in generated code , unless I set the environment variable CPLUS_INCLUDE_PATH to C:\Program Files\Haskell Platform\2013.2.0.0\mingw\lib\gcc\mingw32\4.5.2\include\c++\ , which is the same value as used when compiling wxHaskell. If I copy the contents of C:\Programs\Haskell Platform\2013.2.0.0\ to some other location and let CPLUS_INCLUDE_PATH point to the new location of directory c++, the segmentation fault message reappears. Why is this and how can create an application that also works on another computer? Regards, Henk-Jan van Tuyl * wxHaskell is a binding to the wxWidgets GUI library, which is written in C++
Categories: Offsite Discussion

Consistency issue with type level numeric literals

haskell-cafe - Sat, 12/28/2013 - 10:54am
GHC 7.6.3 has quite convenient type-level numeric literals. We can use numbers like 1 and 2 in types. However, using the type level numeral has been quite a bit of a challenge, illustrated, for example, by the following SO question. http://stackoverflow.com/questions/20809998/type-level-nats-with-literals-and-an-injective-successor It seems the challenge has the reason: the type level numerals and their operations provided in GHC.TypeLits have a consistency issue. The following code demonstrates the issue: it constructs two distinct values of the type Sing 2. Singletons aren't singletons. {-# LANGUAGE KindSignatures #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE PolyKinds #-} module NotSing where import GHC.TypeLits
Categories: Offsite Discussion

[Fp-nl] Call for participation: Dutch FunctionalProgramming Day 2014

haskell-cafe - Fri, 12/27/2013 - 11:32pm
Dear all, The next Netherlands Functional Programming day (NL-FP 2014) will take place on Friday, January 10, 2014 at the University of Amsterdam at Amsterdam Science Park. You are all cordially invited to participate and, of course, to give a presentation. The day will largely follow the pattern of the previous NL-FP days with a moderately timed start, a day of enjoyable talks in between lunch and coffee breaks and ending with a joint dinner in a nearby restaurant. All further details can be found on the NL-FP 2014 site(s): http://staff.science.uva.nl/~grelck/nl-fp-day-2014.html http://staff.science.uva.nl/~grelck/nl-fp-dag-2014.html Hope to see you all in Amsterdam in January! Best regards, Clemens Grelck
Categories: Offsite Discussion

integrating Happy & Alex monads

haskell-cafe - Thu, 12/26/2013 - 10:08pm
I'm working on a program in which I'd like to use Alex and Happy to parse the input. I've written the scanner, and it uses Alex's "monadUserState" wrapper to track source location and various other things. Now, the problem is to integrate it with the parser. As far as I can tell from reading the Happy documentation, I need to use a monadic Parser in Happy as well, but the manuals don't relaly provide a lot of information about how to integrate the two. And I haven't really been able to find many examples of this either. Lots of folks cite "the Haskell parser", although I'm not sure which implementation that's referring to. I did check out the GHC source, and while it contains an Alex parser specification, it doesn't look like anything actually *uses* this, preferring instead a handwritten parser. Could anyone point me to a discussion of how to integrate these two tools, or examples of places where folks have done this before? Thanks much, Richard
Categories: Offsite Discussion

cabal sandboxes executable path

libraries list - Thu, 12/26/2013 - 7:35pm
Hi! After I do `cabal install`, I get two binaries: - in `dist/dist-sandbox-$ID/build/Foo/Foo` - in `.cabal-sandbox/bin/Foo` They seem to be different. Is this ok? Which one of them is the right one? Sorry if I missed this in docs. Thanks. _______________________________________________ Libraries mailing list Libraries< at >haskell.org http://www.haskell.org/mailman/listinfo/libraries
Categories: Offsite Discussion

Top-down inserts in Persistent

haskell-cafe - Thu, 12/26/2013 - 7:17pm
I'm loading data from XML into a Haskell data type, and I'd like to use Persistent to save it to a database. The examples from the Yesod book have you manually define a FooId field and create the relationships yourself from the bottom up. For example, "a person has many cars": blah blah [persistLowerCase| Person name String Car ownerId PersonId Eq name String |] This works well if you're responsible for creating every person/car manually. But what if the data are given to you? If I were to parse people from an XML file, the cars wouldn't have people_ids in them. Instead I'd get, blah blah [persistLowerCase| Person name String cars [Car] Car name String |] As long as the cars list contains another Persistent type, it seems like I should be able to insert a person and have it insert the cars, with proper foreign keys, automatically. Doing it manually isn't straight-forward because I can't add the "ownerId" field to my Car type and still expect to
Categories: Offsite Discussion

parametrized data types and Template Haskell

haskell-cafe - Thu, 12/26/2013 - 1:36pm
Dear Cafe, Hope you all had a nice Christmas. I have been playing with generating method instances using Template Haskell but am a bit stuck now trying to generate an instance for a parametrized data type. I would like to generate the following: > instance (MyClass a) => MyClass (Tree a) where > mymethod _ = "todo" I defined a genMyClassInstance that is working fine for unparametrized data types, but clearly there is nothing here that inserts the '(MyClass a) =>' part here. My first question is: how should I instruct Template Haskell to insert the beforementioned code when appropriate? > genMyClassInstance :: Name -> Q [Dec] > genMyClassInstance name > = [d|instance MyClass $(conT name) where > mymethod _ = "todo" > |] My second question is how to pass the Name of a parametrized data type? I tried the following, but GHC does not seem to like that: "Not in scope: type constructor or class `Tree a' Perhaps you meant `Tree'" > $(genMyInstance (mkName
Categories: Offsite Discussion

(automatically) adding import statements in vim

haskell-cafe - Wed, 12/25/2013 - 1:45pm
Are there any tools or vim-plugins that will automatically add import statements? For instance, I have the following code: ... import Data.Maybe (fromJust) import Text.ParserCombinators.Parsec (ParseError) import Text.Printf (printf) ... parseMyString :: String -> Either ParseError String parseMyString stringToParse = parse myParser "(unknown)" stringToParse Here's what I want to have happen. I put my cursor over "parse" and press some keystroke. It automatically adds the parse function to the list of import statements from the Text.ParserCombinators.Parsec module (hopefully sorted alphabetically). So the import statements end up looking like this: ... import Data.Maybe (fromJust) import Text.ParserCombinators.Parsec (ParseError, parse) import Text.Printf (printf) ... The haskellmode vim plugin (https://github.com/lukerandall/haskellmode-vim) has functionality similar to this, but it can only add new import lines. It can't add functions/types to existing import lines. The best it can do is some
Categories: Offsite Discussion

Parse HTML that is contain javascript

haskell-cafe - Tue, 12/24/2013 - 9:03pm
Hi, I am Akira. I want to parse HTML file that is contain javascript. But I cant come up with how to deal with script tag. Is there anyone help me? Details of probrem HTML code I want to parse is like following <html> <script> //<![CDATA[ <!-- --> //]]> </script> </html> Because '<' is used as normal character in the script region, I can not use my HTML parser there. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Munich Haskell Holiday Meeting

haskell-cafe - Tue, 12/24/2013 - 12:37pm
Dear all, I want to announce a special holiday meeting of Munich's Haskell user group. It will take place on the 27th of December at 19h30 at Cafe Puck. Check out the details here: http://www.haskell-munich.de/news I wish everyone a nice holiday! Heinrich
Categories: Offsite Discussion

forever function laziness

haskell-cafe - Tue, 12/24/2013 - 4:02am
Hello, guys. Recently I came across the definition of the function 'forever' on hoogle. I am intrigued that it works. The recursive definition does make sense to me in a mathematical way, but I can't figure out how it works under the hood in terms of thunks. To tell you the truth, I don't know how laziness works in general in haskell. Can someone help me understand how it works in this example, and give some pointers to materials on the subject? The "tying the knot" article on the wiki is pretty mind bending too.
Categories: Offsite Discussion

hslogger and metalog compatibility

haskell-cafe - Mon, 12/23/2013 - 11:20pm
Is anyone else using metalog (syslog implementation) along with hslogger to log to syslog? If I run the following with syslog-ng, it works. With metalog, I get nothing. Just want to make sure it isn't me before I report it. Prelude> :set prompt "ghci> " ghci> :m +System.Log.Logger ghci> :m +System.Log.Handler.Syslog ghci> sl <- openlog rootLoggerName [] USER DEBUG ghci> updateGlobalLogger rootLoggerName (addHandler sl) ghci> errorM rootLoggerName "This won't show up with metalog."
Categories: Offsite Discussion

[ANN] shapely-data v0.1

General haskell list - Mon, 12/23/2013 - 8:20pm
This is the first *real* release `shapely-data`, a haskell library up here on hackage: http://hackage.haskell.org/package/shapely-data for working with algebraic datatypes in a simple generic form made up of haskell's primitive product, sum and unit types: `(,)`, `Either`, and `()`. You can install it with cabal install shapely-data # Motivation and examples In order from most to least important to me, here are the concerns that motivated the library: - Provide a good story for `(,)`/`Either` as a *lingua franca* generic representation that other library writers can use without dependencies, encouraging abstractions in terms of products and sums (motivated specifically by my work on `simple-actors`: http://hackage.haskell.org/package/simple-actors - Support algebraic operations on ADTs, making types composable -- multiplication: let a = (X,(X,(X,()))) b = Left (Y,(Y,())) :: Either (Y,(Y,())) (Z,()) ab = a >*< b in ab == ( Left (X,(X,(X
Categories: Incoming News

NL-FP Day 2014, January 10, Update

haskell-cafe - Mon, 12/23/2013 - 5:14pm
Dear all, A warm welcome to all who registered since the last update email. As of today, we expect 56 participants to the 22nd Netherlands Functional Programming Day in 2014. All news regarding the day itself including - a complete programme, - abstracts for most of the talks, - an updated list of participants, - dinner location (de ponteneur), - registration fee (25EUR) can be found at http://staff.science.uva.nl/~grelck/nl-fp-day-2014.html http://staff.science.uva.nl/~grelck/nl-fp-dag-2014.html Merry Christmas and best wishes for the new year, Clemens
Categories: Offsite Discussion

Call for participation: Dutch Functional Programming Day2014

General haskell list - Mon, 12/23/2013 - 4:14pm
Dear all, The next Dutch Functional Programming day (NL-FP 2014) will take place on Friday, January 10, 2014 at the University of Amsterdam at Amsterdam Science Park. You are all cordially invited to participate: registration is still open. The complete programme including abstracts of the talks as well as all further details can be found on the NL-FP 2014 site(s): http://staff.science.uva.nl/~grelck/nl-fp-day-2014.html http://staff.science.uva.nl/~grelck/nl-fp-dag-2014.html Merry Christmas and best wishes for the new year, Clemens Grelck
Categories: Incoming News

Access to Mac OS X needed

haskell-cafe - Mon, 12/23/2013 - 3:56pm
Hi, I am working on fswatch[1,2], a cross-platform file system notification library. [1]: http://hackage.haskell.org/package/fsnotify [2]: https://github.com/haskell-fswatch/hfsnotify Occasionally it needs to be tested on Mac OS X. Could someone give me an unprivileged ssh access to a Mac OS X host with an installed Haskell Platform for this purpose? Roman _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Building PanDoc for iOS target,but failed in Haskell Template requirement by 'aeson' package

haskell-cafe - Mon, 12/23/2013 - 1:51pm
Hi, I've been trying to cross-compile PanDoc for iOS target for the last few days. I have been quite successfull from building stage-1 GHC for iOS target and many packages dependencies required by PanDoc until I see that 'aeson' package require Haskell Template which is not supported in cross compilation. As pointed in iOS CrossCompiling Wiki page, it seems that Template Haskell doesn't work yet and still in wish list. Is there any hack or workaround to be able to cross-compile 'aeson' package for iOS target? Can I compile 'aeson' without Haskell Template? Anybody know when Template Haskell in CrossCompiling for iOS will be added? Thanks a lot! Best regards, Joe_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion