Re: [Haskell-cafe] haskell/clojure job opprtunity
Hello, On Wed, 2011-11-09 at 15:06 -0800, Vagif Verdi wrote: We use yesod (haskell web framework) for internal web application and web services, and compojure (clojure web framework) for customer facing web site. Just out of curiousity: Are there specific reasons for not using Haskell on the customer facing side as well? Cheers, hvr ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Bounds checking pragma?
2011/11/10 Daniel Fischer daniel.is.fisc...@googlemail.com: There's a problem here, unsafeAt uses an Int index into the array, while (!) uses the declared index type. Even skipping the bounds check, you'd still have to calculate the Int index for the replacement of (!). #ifdef OMIT_BOUNDS_CHECK {-# RULES ArrayIndex arr ! i = unsafeAt arr (unsafeIndex (bounds arr) i) #-} #endif Thanks! (?) = unsafeAt Yes, but (!) was taken as an example. There is a lot of other functions doing bounds checking... Creating replacements for every single function is rather tedious. The flag pragma also has other uses. For example, we can introduce an overflow flag (check every operation with Int's for overflow) , which may be useful for debugging. In release version this flag will be turned off. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] [ANN] transformers-base, transformers-abort, monad-abort-fd
Hi Cafe. I've been using these three small transformer libraries for awhile, so it's probably time to announce them. transformers-base[1] introduces a generalized version of MonadIO, MonadBase (BaseM in monadLib terms). It's very useful when you are trying to make a stateful API work in both IO and STM (and all transformer stacks on top of them). transformers-abort[2] basically gives you two versions of EitherT, one for errors and one for short-circuiting. Includes instances for semigroupoids and monad-control classes. monad-abort-fd[3] is a typical companion auto-lifter package for transformers-abort. But it also provides a generalized version[4] of Control.Exception which tries to thread effects properly (e.g. finalizers can read (if control didn't escape) and modify the state in StateT). [1] http://hackage.haskell.org/package/transformers-base [2] http://hackage.haskell.org/package/transformers-abort [3] http://hackage.haskell.org/package/monad-abort-fd [4] http://hackage.haskell.org/packages/archive/monad-abort-fd/0.3/doc/html/src/Control-Monad-Exception.html ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] howto best use emacs + tiling WM (Xmonad,DWM)
A little delayed, but might be useful. I personally use icicles. I found the M-* great for narrowing results down. I've tried anything and ido also, but icicles ended up winning, for my taste at least. A side note, speedbar actually *does* works for bufffers. Simply type *b* on the speedbar and you get the buffers list. That may help you also. As others sugested, the vanila interface of emacs is not perfect. Try icicles, ido or anything, they greatly improve usability. Another useful library is windmove and framemove. They assist switching between visible buffers/frames: http://www.emacswiki.org/emacs/Icicles http://www.emacswiki.org/emacs/WindMove http://www.emacswiki.org/emacs/FrameMove Hope you find those useful! ~dsouza At Fri, 4 Nov 2011 08:55:22 -0700 (PDT), kaffeepause73 wrote: Hello, I'm using dwm which I really love (ev. consider switching to xmonad). However when I'm working with emacs (programming haskell) und dwm I feel, I'm not as effecient as I eventually could be. -- I can have the shell in one window (to execute the compiled program), but most work happens in emacs (in one screen only). And I have up to buffers in emacs which I find hard to switch between. Even on Xinerama this doesn't really change. When I create new frames for emacs with strg-x 5-2 then I'm sort getting closer to where I would like to be, but then I find myself having to windows on which I switch buffers and I get confused again. What I would like is to tab through the buffers, as I walk through the screens in dwm/xmonad and see the list of buffers as id do so. -- And can directly jump to a specific buffer via e.g. mod-4. I'm thinking that each buffer in emacs gets one frame and occupies one screen and xmonad than gets dynamically 20 or more screens (like tabs). If there is an good solution within emacs and the emacs mode than I'm of course also more than open for it. (my experience with emacs so far: -- only 10 buffers are listed in menue -- speedbar is very nice but works for files not for buffers -- using list all buffers is sort of cluncy as it uses half the screen (my screen splits horizontally Thanks, Phil -- View this message in context: http://haskell.1045720.n5.nabble.com/howto-best-use-emacs-tiling-WM-Xmonad-DWM-tp4964482p4964482.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ 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
[Haskell-cafe] graphviz: dotizeGraph and graphToGraph not adding positions
My understanding of the documentation for Data.GraphViz.dotizeGraph and graphToGraph is that they should add position attributes to a graph. But they always seem to return graphs with empty attribute lists. What am I doing wrong in the following tiny example? dotizeGraph nonClusteredParams (insNode (0, Blah) $ empty :: Gr String ()) 0:([],Blah)-[] I expected the first list to contain at least a Pos attribute. I have written a wrapper around /usr/share/dot which shows the program is outputting positional information. --Max ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] haskell/clojure job opprtunity
No reasons at all. It's just historically been been written in java. (about 10 years ago) Most of the web site can be done in haskell. Some functionality though requires java (pdf library). If haskell has pdf library with similar functionality then al of it can be done in haskell. Going forward we intend to use haskell where it is possible and fall back to clojure/ java only when no suited library exists for haskell. On Nov 10, 12:42 am, Herbert Valerio Riedel h...@gnu.org wrote: Hello, On Wed, 2011-11-09 at 15:06 -0800, Vagif Verdi wrote: We use yesod (haskell web framework) for internal web application and web services, and compojure (clojure web framework) for customer facing web site. Just out of curiousity: Are there specific reasons for not using Haskell on the customer facing side as well? Cheers, hvr ___ 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/listinfo/haskell-cafe
Re: [Haskell-cafe] [ANN] transformers-base, transformers-abort, monad-abort-fd
On 10 November 2011 12:58, Mikhail Vorozhtsov mikhail.vorozht...@gmail.com wrote: transformers-base[1] introduces a generalized version of MonadIO, MonadBase (BaseM in monadLib terms). Hi Mikhail, nice packages! I'm currently giving monad-control a new design and I'm planning to generalize MonadControlIO to MonadBaseControl. I would like to use your MonadBase as a super class of MonadBaseControl. However, your package depends on monad-control to define a similar class. Of course this prevents monad-control to depend on transformers-base. Are you willing to drop the monad-control dependency (and remove Control.Monad.Base.Control)? I send you a pull request that implements this change. The pull request also contains a patch that makes some other changes: * Use CPP macros to abstract the repetitious instances * Add instances for all base monads in the base library * Use descriptive variable names: 'm' for monad, 'b' for base monad * Reversed order of 'b' and 'm' to match BaseM from monadLib Hopefully you are fine with these changes, otherwise no hard feelings ;-) Cheers, Bas ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] timezone-series, timezone-olson dependencies
Is there a reason why the current version of the timezone-series and timezone-olson packages depend on time1.3? With time 1.4 being widely used at this point this will cause conflicts with many packages yet my tests show that both packages work fine with time 1.4. Could we have this upper bound bumped to 1.5? Cheers, - Ben ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [ANN] transformers-base, transformers-abort, monad-abort-fd
On Thu, Nov 10, 2011 at 2:54 PM, Bas van Dijk v.dijk@gmail.com wrote: * Use descriptive variable names: 'm' for monad, 'b' for base monad It's funny how we, haskellers, find 'm' and 'b' descriptive names. I know many programmers who would cry after seeing this =). Cheers, -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [ANN] transformers-base, transformers-abort, monad-abort-fd
What about base instead of b? I don't think we should change m since that name is used to denote a monad in almost any Haskell library I know. On 10 November 2011 19:07, Colin Adams colinpaulad...@gmail.com wrote: And quite rightly too. On 10 November 2011 18:02, Felipe Almeida Lessa felipe.le...@gmail.com wrote: On Thu, Nov 10, 2011 at 2:54 PM, Bas van Dijk v.dijk@gmail.com wrote: * Use descriptive variable names: 'm' for monad, 'b' for base monad It's funny how we, haskellers, find 'm' and 'b' descriptive names. I know many programmers who would cry after seeing this =). Cheers, -- Felipe. ___ 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] timezone-series, timezone-olson dependencies
Ben Gamari wrote: Is there a reason why the current version of the timezone-series and timezone-olson packages depend on time1.3? With time 1.4 being widely used at this point this will cause conflicts with many packages yet my tests show that both packages work fine with time 1.4. Could we have this upper bound bumped to 1.5? Done. The version of each package was bumped to 0.1.2 to support the new dependency. Also, catTZ.hs had been missing from the darcs repo, though it is included in the hackage distribution package. Thanks for the heads-up, Ben! Regards, Yitz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Easiest to use NoSQL storage with Haskell?
On Wed, 9 Nov 2011 20:34:11 +0300, dokondr doko...@gmail.com wrote: I am wondering if Database.Persist can work with key/value storage such as Riak or SimpleDB where records are lists of key/value pairs and any two lists can have different keys? Is simple implementation of 'persistent' based on files with key/value records possible? For example 'persistent' based on KyotoCabinet package? (http://hackage.haskell.org/package/KyotoCabinet)http://hackage.haskell.org/package/KyotoCabinet As far as I know, persistent doesn't depend on any particular backend, but as far as NoSQL-stuff goes, I think there's only persistent-mongodb at the moment. I don't know how much work it is to create a new backend (and if it's worth the effort in your case), but this looks like a good place to start: http://hackage.haskell.org/packages/archive/persistent/0.6.4/doc/html/Database-Persist.html#t:PersistBackend Cheers, Daniel pgpJFU0H52TZ9.pgp Description: PGP signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Data.Vector.Unboxed
Does Repa always use unboxed Vectors? But a Repa array can store any element, so how does it handles types which haven't an unboxed equivalent? Or is the unboxing done automatically? 2011/11/10 Bas van Dijk v.dijk@gmail.com On 9 November 2011 22:33, kaffeepause73 kaffeepaus...@yahoo.de wrote: Repa is indeed very Interesting, but I have changing vector length in the second dimension and later on only want to generate Data on demand. If I use Matrices, I will use loads of space for no reason. Even if it is possible to create an unboxed vector of unboxed vectors, if the inner unboxed vectors have variable lengths as you require, indexing will become O(n) instead of O(1) because you need to traverse the inner unboxed vectors and check their length to find the desired index. I'm not sure that's what you want. Seems like sticking to Boxed Vector for now is best Choice for me. Yes your second alternative: a boxed vector of unboxed vectors seems to do what you want. isn't data.vector also providing multidimensional arrays? I don't think so. All indexing functions get a single Int argument. Of course it's easy to build a layer on top that adds more dimensions. So is Repa just another Version of Data.Vector or is it building another level on top. The latter, repa provides a layer on top of vector. Note that you can also convert Vectors to repa Arrays using: fromVector :: Shape sh = sh - Vector a - Array sh a I believe its O(1). And when to use best which of the two ? I guess when your vectors are multi-dimensional and you want to benefit from parallelism you should use repa instead of vector. Cheers, Bas ___ 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] Data.Vector.Unboxed
Yes, it does. You can only use members of the Elt class in repa arrays, and Elt has Unbox as a superclass. On Thu, Nov 10, 2011 at 5:03 PM, Yves Parès limestr...@gmail.com wrote: Does Repa always use unboxed Vectors? But a Repa array can store any element, so how does it handles types which haven't an unboxed equivalent? Or is the unboxing done automatically? 2011/11/10 Bas van Dijk v.dijk@gmail.com On 9 November 2011 22:33, kaffeepause73 kaffeepaus...@yahoo.de wrote: Repa is indeed very Interesting, but I have changing vector length in the second dimension and later on only want to generate Data on demand. If I use Matrices, I will use loads of space for no reason. Even if it is possible to create an unboxed vector of unboxed vectors, if the inner unboxed vectors have variable lengths as you require, indexing will become O(n) instead of O(1) because you need to traverse the inner unboxed vectors and check their length to find the desired index. I'm not sure that's what you want. Seems like sticking to Boxed Vector for now is best Choice for me. Yes your second alternative: a boxed vector of unboxed vectors seems to do what you want. isn't data.vector also providing multidimensional arrays? I don't think so. All indexing functions get a single Int argument. Of course it's easy to build a layer on top that adds more dimensions. So is Repa just another Version of Data.Vector or is it building another level on top. The latter, repa provides a layer on top of vector. Note that you can also convert Vectors to repa Arrays using: fromVector :: Shape sh = sh - Vector a - Array sh a I believe its O(1). And when to use best which of the two ? I guess when your vectors are multi-dimensional and you want to benefit from parallelism you should use repa instead of vector. Cheers, Bas ___ 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 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] graphviz: dotizeGraph and graphToGraph not adding positions
On 11 November 2011 02:19, Max Rabkin max.rab...@gmail.com wrote: My understanding of the documentation for Data.GraphViz.dotizeGraph and graphToGraph is that they should add position attributes to a graph. But they always seem to return graphs with empty attribute lists. What am I doing wrong in the following tiny example? dotizeGraph nonClusteredParams (insNode (0, Blah) $ empty :: Gr String ()) 0:([],Blah)-[] I expected the first list to contain at least a Pos attribute. I have written a wrapper around /usr/share/dot which shows the program is outputting positional information. OK, a bug has crept in, I'll have a look at it next week. -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Getting started on Mac OSX
I have a book on Haskell, and I've downloaded and installed Haskell Platform for Mac OS X. What do I do now? XCode is a requirement, and I have it, but I don't know how to run it. To begin with, I want to test small examples from the book, using ghc or ghci. I have read file:///Library/Haskell/doc/start.html. - Where is the software I've just installed? - How is ghci started? Or the platform, whatever that is? Many thanks if you can help me! Helge -- View this message in context: http://haskell.1045720.n5.nabble.com/Getting-started-on-Mac-OSX-tp4983597p4983597.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Getting started on Mac OSX
Try going into your terminal and typing ghci or ghc CLI is usually the common way of accessing ghc and ghci. I haven't installed the platform on my mac yet so I dont know any sort of ui is provided. Writing your code in xcode and then compiling via terminal isn't all that bad, you'll get used to it. Same with using ghci, i believe. Shouldn't be all that bad on the terminal. Regards, Sunny On Fri, Nov 11, 2011 at 2:10 AM, hstenstrom h.stenst...@gmail.com wrote: I have a book on Haskell, and I've downloaded and installed Haskell Platform for Mac OS X. What do I do now? XCode is a requirement, and I have it, but I don't know how to run it. To begin with, I want to test small examples from the book, using ghc or ghci. I have read file:///Library/Haskell/doc/start.html. - Where is the software I've just installed? - How is ghci started? Or the platform, whatever that is? Many thanks if you can help me! Helge -- View this message in context: http://haskell.1045720.n5.nabble.com/Getting-started-on-Mac-OSX-tp4983597p4983597.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ 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] Getting started on Mac OSX
**Addendum:* *You might want to check out some the resources available at http://www.haskell.org/haskellwiki/Mac_OS_X On Fri, Nov 11, 2011 at 2:46 AM, Sunny Basi sunny.b...@gmail.com wrote: Try going into your terminal and typing ghci or ghc CLI is usually the common way of accessing ghc and ghci. I haven't installed the platform on my mac yet so I dont know any sort of ui is provided. Writing your code in xcode and then compiling via terminal isn't all that bad, you'll get used to it. Same with using ghci, i believe. Shouldn't be all that bad on the terminal. Regards, Sunny On Fri, Nov 11, 2011 at 2:10 AM, hstenstrom h.stenst...@gmail.com wrote: I have a book on Haskell, and I've downloaded and installed Haskell Platform for Mac OS X. What do I do now? XCode is a requirement, and I have it, but I don't know how to run it. To begin with, I want to test small examples from the book, using ghc or ghci. I have read file:///Library/Haskell/doc/start.html. - Where is the software I've just installed? - How is ghci started? Or the platform, whatever that is? Many thanks if you can help me! Helge -- View this message in context: http://haskell.1045720.n5.nabble.com/Getting-started-on-Mac-OSX-tp4983597p4983597.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ 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