[Haskell-cafe] Conditional compilation for different versions of GHC?

2010-11-27 Thread Jinjing Wang
Dear list, From ghc 7.0.1 release notes: The Language.Haskell.TH.Quote.QuasiQuoter type has two new fields: quoteType and quoteDec. Some of my code needs to be conditionally compiled to support both version 6 and 7, what is the recommended way to do it? ref: *

Re: [Haskell-cafe] Conditional compilation for different versions of GHC?

2010-11-27 Thread Jinjing Wang
automatically? : ) Best, On Sun, Nov 28, 2010 at 1:32 AM, Michael Snoyman mich...@snoyman.com wrote: On Sat, Nov 27, 2010 at 6:59 PM, Jinjing Wang nfjinj...@gmail.com wrote: Dear list, From ghc 7.0.1 release notes: The Language.Haskell.TH.Quote.QuasiQuoter type has two new fields: quoteType

Re: [Haskell-cafe] Conditional compilation for different versions of GHC?

2010-11-27 Thread Jinjing Wang
Sorry, should be `cabal install --flags=ghc7 package-name`. On Sun, Nov 28, 2010 at 1:59 AM, Jinjing Wang nfjinj...@gmail.com wrote: Thanks Michael, So the user should use `cabal install --flags -ghc7 package-name` to install the package, if I'm not mistaken? Will it work if the package

Re: [Haskell-cafe] Conditional compilation for different versions of GHC?

2010-11-27 Thread Jinjing Wang
wrote: On Sat, Nov 27, 2010 at 10:59 AM, Jinjing Wang nfjinj...@gmail.com wrote: Dear list, From ghc 7.0.1 release notes: The Language.Haskell.TH.Quote.QuasiQuoter type has two new fields: quoteType and quoteDec. Some of my code needs to be conditionally compiled to support both version 6

Re: [Haskell-cafe] Conditional compilation for different versions of GHC?

2010-11-27 Thread Jinjing Wang
: Warning: Fields of `QuasiQuoter' not initialised: quoteType, quoteDec So far it works without problem. On Sun, Nov 28, 2010 at 10:38 AM, Jinjing Wang nfjinj...@gmail.com wrote: Hi Michael, you are absolutely correct, cabal did set the flags automatically. To sum up, here's what needs to be done

Re: [Haskell-cafe] Conditional compilation for different versions of GHC?

2010-11-27 Thread Jinjing Wang
Thanks for explaining, it's a nice trick. On Sun, Nov 28, 2010 at 11:16 AM, Antoine Latter aslat...@gmail.com wrote: On Sat, Nov 27, 2010 at 8:38 PM, Jinjing Wang nfjinj...@gmail.com wrote: Hi Michael, you are absolutely correct, cabal did set the flags automatically. To sum up, here's what

Re: [Haskell-cafe] install GHC 7.0.1 RC on OS X?

2010-11-02 Thread Jinjing Wang
you can: mv /Library/Frameworks/GHC.framework /Library/Frameworks/GHC.framework.2 then install GHC 7 just toggle between those paths to switch version ... On Tue, Nov 2, 2010 at 1:07 AM, Edward Amsden eca7...@cs.rit.edu wrote: I'd like to install the GHC 7.0.1 RC on my mac (Snow Leopard,

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-17 Thread Jinjing Wang
John Millikin wrote: The reason many Japanese and Chinese users reject UTF-8 isn't due to space constraints (UTF-8 and UTF-16 are roughly equal), it's because they reject Unicode itself. +1. This is the thing Unicode advocates don't want to admit. Until Unicode has code points for _all_

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: jhc 0.7.4

2010-08-09 Thread Jinjing Wang
I think the default locale of the terminal app on snow leopard is utf-8. I can also report that I have no problem compiling the tar version of jhc 0.7.4 on snow leopard 10.6.4 using ghc 6.12.1, need to install the editline package though. On Sun, Jul 11, 2010 at 5:33 AM, John Meacham

Re: [Haskell-cafe] proposal: HaBench, a Haskell Benchmark Suite

2010-06-25 Thread Jinjing Wang
poor man's benchmark :) http://github.com/nfjinjing/bench-euler multi core aware, use bench-euler +RTS -N2 where 2 means 2 cores, and watch your cpu fries :) On Fri, Jun 25, 2010 at 7:24 AM, Andy Georges andy.geor...@elis.ugent.be wrote: Hi Simon et al, I've picked up the

[Haskell-cafe] yet another functional reactive programming tutorial :)

2010-05-26 Thread Jinjing Wang
Dear list, As I'm learning frp and reading the wonderful tutorial at http://www.formicite.com/dopage.php?frp/frp.html , I'm putting up some more basic cheatsheet style tutorial for myself. http://github.com/nfjinjing/frp-guide Feel free to take advantage of it. -- jinjing

Re: [Haskell-cafe] About code style ?

2010-02-02 Thread Jinjing Wang
fac n = let { f = foldr (*) 1 [1..n] } in f :D sorry for double reply, need to cc cafe, this is fun. On Tue, Feb 2, 2010 at 4:33 PM, zaxis z_a...@163.com wrote: thanks for all suggestions. zaxis wrote: For me i like C style instead of layout. For example, func1 a = do      -- ...  

Re: [Haskell-cafe] Web application interface

2010-01-13 Thread Jinjing Wang
The hyena backend is essentially just a translator between hack and wai, i failed to finished it since I can't understand iteratee (seriously) and eventually got distracted ... What hyena tries to solve can't be realized in hack, so there's not too much reason for a backend anyway. Hyena is

Re: [Haskell-cafe] GHC 6.12 on OS X 10.5

2009-12-21 Thread Jinjing Wang
not sure if this helps, but try: # ports share lib export export CPATH=~/local/include export LIBRARY_PATH=~/local/lib export LD_LIBRARY_PATH=~/local/lib export DYLD_LIBRARY_PATH=~/local/lib replace ~/local/ with your ports path On Tue, Dec 22, 2009 at 5:43 AM, Tom Tobin korp...@korpios.com

[Haskell-cafe] ANN: moe html combinator

2009-08-27 Thread Jinjing Wang
hand written html is fine, except for the closing tags: what if html' - do head' - do meta [http_equiv Content-Type, content text/html; charset-utf-8] (/) title' - str my title link [rel icon, _type image/png, href panda_icon.png] (/)

Re: [Haskell-cafe] ANN: yst 0.2.1

2009-08-03 Thread Jinjing Wang
It's possible to serve the generated site with maid, in case apache is not available: cabal update cabal install maid yst create testsite cd testsite yst cd site maid now goto http://localhost:3000/ On Mon, Aug 3, 2009 at 9:05 AM, John MacFarlanej...@berkeley.edu wrote: I'm pleased to

[Haskell-cafe] Help needed to pick a better name then hack

2009-07-03 Thread Jinjing Wang
Hack is such an inconvenient name for a package, may I get some inspiration from renaming it? Also, is there an idiom to use when upgrading package name on hackage? Best, -- jinjing ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] ANN: loli: a minimal web dev DSL

2009-06-29 Thread Jinjing Wang
loli is a DSL built on hack. It allows you to easily define routes, build your custom template backends through a simple Template interface, and integrate with other hack middleware. * driver The simplest app looks like this import Network.Loli import Hack.Handler.Happstack

[Haskell-cafe] [ANN] Nemesis : easy task management

2009-06-12 Thread Jinjing Wang
You can have a description file named Nemesis, with content nemesis = do clean [ **/*.hi , **/*.o , manifest ] task dist $ do sh cabal clean sh cabal configure sh cabal sdist task i (sh ghci -isrc

Re: [Haskell-cafe] ANN: Cute Hack - Hyena handler + Bamboo Blog Engine :)

2009-04-25 Thread Jinjing Wang
= do  env - get_env  response - app env .liftIO  -- set response  response.headers.mapM_ (splash setHeader)  response.status.show.setHeader Status  response.body.output On Apr 25, 2009, at 7:58 AM, Jinjing Wang wrote: Hia, A few interesting progress on Hack: * many middleware ported

[Haskell-cafe] ANN: Cute Hack - Hyena handler + Bamboo Blog Engine :)

2009-04-24 Thread Jinjing Wang
Hia, A few interesting progress on Hack: * many middleware ported from Rack, including a lambda! ( just like a pony for wsgi, and a lobster for rack ) * 2 handlers, one for Kibro on fcgi / lighttpd, one for Hyena web server * apps are portable, Bamboo is a port of Panda that runs on Hack, works

[Haskell-cafe] [ANN] Hack: a sexy Haskell Webserver Interface ^^

2009-04-20 Thread Jinjing Wang
Simplest app should look like this module Main where import Hack import Hack.Handler.Kibro hello :: Application hello = \env - return $ Response { status = 200 , headers = [ (Content-Type, text/plain) ] , body= Hello World } main =