Re: [Haskell-cafe] Is there a way to find out the type inferred for a local function inside another function? :)

2011-04-08 Thread Magnus Therning
AFAIK there is no way to do that, thouhg scion[1] may offer it. Personally I develop more complex local functions at the top-level, and once I'm happy with it I perform some re-factoring and move it in. /M [1]: https://github.com/nominolo/scion/blob/master/README.markdown -- Magnus Therning  

[Haskell-cafe] Testing Implementation vs Model - Records or Type Classes?

2011-04-08 Thread Heinrich Apfelmus
Hello, I'm writing a small Haskell library for functional reactive programming. The core of the library consists of two data types and several primitives. However, I have programmed this core *twice*: once as a *model* that displays the intended semantics, and once as the actual

[Haskell-cafe] Parsing HTML tables with HXT

2011-04-08 Thread Dmitry Simonchik
Dear Cafe, Can someone please help me with getting the value of the table cell with HXT in the following html: table class=tblc tr td class=tdcx/td tdy/td /tr tr td class=tdca/td tdb/td /tr /table I need the value of the second cell in a row that has first cell with some predefined

[Haskell-cafe] FFI for a beginner

2011-04-08 Thread Andrew Pennebaker
ncurses is proving too difficult to setup, so I'm working on a new library called charm. The C code works by itself, but I can't compile a Haskell wrapper for it. While the tutorials at HaskellWikihttp://www.haskell.org/haskellwiki/FFI_complete_examplesare helpful, they're outdated. Argh! The

[Haskell-cafe] fmap and LaTeX

2011-04-08 Thread Mitar
Hi! Is there for $ (fmap) operator some nice looking symbol in mathematics, LaTeX? I am looking here: http://www.soi.city.ac.uk/~ross/papers/Applicative.html http://www.haskell.org/ghc/docs/6.12.1/html/libraries/base/Control-Applicative.html but only for other operators there are nice symbols,

Re: [Haskell-cafe] fmap and LaTeX

2011-04-08 Thread Daniel Fischer
On Friday 08 April 2011 14:05:46, Mitar wrote: I have also tried \mathbin{\$} but it adds space around $ (at least in lhs2tex), so it looks ugly. Would \mathbin{\langle\$\rangle} look better? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] fmap and LaTeX

2011-04-08 Thread Henning Thielemann
Mitar schrieb: Hi! Is there for $ (fmap) operator some nice looking symbol in mathematics, LaTeX? I am looking here: http://www.soi.city.ac.uk/~ross/papers/Applicative.html http://www.haskell.org/ghc/docs/6.12.1/html/libraries/base/Control-Applicative.html but only for other

Re: [Haskell-cafe] Is there a way to find out the type inferred for a local function inside another function? :)

2011-04-08 Thread Henning Thielemann
Magnus Therning schrieb: AFAIK there is no way to do that, thouhg scion[1] may offer it. Personally I develop more complex local functions at the top-level, and once I'm happy with it I perform some re-factoring and move it in. I would not write large local functions at all. I would leave

Re: [Haskell-cafe] fmap and LaTeX

2011-04-08 Thread Mitar
Hi! Uuu, nice. Thanks Daniel and Henning. Mitar ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Is there a way to find out the type inferred for a local function inside another function? :)

2011-04-08 Thread Evan Laforge
On Fri, Apr 8, 2011 at 5:24 AM, Henning Thielemann schlepp...@henning-thielemann.de wrote: Magnus Therning schrieb: AFAIK there is no way to do that, thouhg scion[1] may offer it. Personally I develop more complex local functions at the top-level, and once I'm happy with it I perform some

Re: [Haskell-cafe] Testing Implementation vs Model - Records or Type Classes?

2011-04-08 Thread Twan van Laarhoven
On 08/04/11 11:54, Heinrich Apfelmus wrote: Hello, I'm writing a small Haskell library for functional reactive programming. The core of the library consists of two data types and several primitives. However, I have programmed this core *twice*: once as a *model* that displays the intended

Re: [Haskell-cafe] fmap and LaTeX

2011-04-08 Thread Daniel Fischer
On Friday 08 April 2011 14:25:41, Mitar wrote: Hi! Uuu, nice. Thanks Daniel and Henning. Alternatively, you can kill off the spaces '' and '' produce using \mspace, \newcommand{\ltgt}[1]{\mathbin{\mspace{-6mu}#1\mspace{-6mu}}} \newcommand{\fmap}{\ltgt{\$}} The value used in \mspace can

Re: [Haskell-cafe] Is there a way to find out the type inferred for a local function inside another function? :)

2011-04-08 Thread Magnus Therning
On Fri, Apr 8, 2011 at 13:24, Henning Thielemann schlepp...@henning-thielemann.de wrote: Magnus Therning schrieb: AFAIK there is no way to do that, thouhg scion[1] may offer it. Personally I develop more complex local functions at the top-level, and once I'm happy with it I perform some

Re: [Haskell-cafe] Is there a way to find out the type inferred for a local function inside another function? :)

2011-04-08 Thread 山本和彦
Currently what I do is declare a signature for helper, and then if it gets a type error try to figure out how to fix it. It's usually not very hard, but it would be slick to have the signature filled in automatically. Try ghc-mod on Hackage if you are an Emacs user. If GHC can guess the

Re: [Haskell-cafe] Is there a way to find out the type inferred for a local function inside another function? :)

2011-04-08 Thread 山本和彦
I made a mistake. Use M-t instead of C-cC-t. Currently what I do is declare a signature for helper, and then if it gets a type error try to figure out how to fix it. It's usually not very hard, but it would be slick to have the signature filled in automatically. Try ghc-mod on Hackage if

Re: [Haskell-cafe] Is there a way to find out the type inferred for a local function inside another function? :)

2011-04-08 Thread Lyndon Maydwell
Agda's concept of holes seems perfect for this. Does Haskell have anything similar? On Fri, Apr 8, 2011 at 9:50 PM, Kazu Yamamoto k...@iij.ad.jp wrote: I made a mistake. Use M-t instead of C-cC-t. Currently what I do is declare a signature for helper, and then if it gets a type error try to

[Haskell-cafe] erratic behavior for System.Time.diffClockTimes

2011-04-08 Thread Warren Harris
I'm trying out GHC-7.0.3-x86_64 for Mac OS X and see what seems to be a bug in System.Time.diffClockTimes. The TimeDiff tdPicosec field returns values that seem to jump around erratically: test = do startTime - System.Time.getClockTime endTime - System.Time.getClockTime let dt =

Re: [Haskell-cafe] Stateful iteratees

2011-04-08 Thread Maciej Marcin Piechotka
On Thu, 2011-04-07 at 19:04 +0200, Ertugrul Soeylemez wrote: Hello fellow Haskellers, I'm trying to solve a very practical problem: I need a stateful iteratee monad transformer. Explicit state passing is very inconvenient and would destroy the elegance of my library. There are two

Re: [Haskell-cafe] erratic behavior for System.Time.diffClockTimes

2011-04-08 Thread Bas van Dijk
On 8 April 2011 22:48, Warren Harris warrensomeb...@gmail.com wrote: I'm trying out GHC-7.0.3-x86_64 for Mac OS X and see what seems to be a bug in System.Time.diffClockTimes. The TimeDiff tdPicosec field returns values that seem to jump around erratically Strange. This doesn't happen on my

Re: [Haskell-cafe] erratic behavior for System.Time.diffClockTimes

2011-04-08 Thread Antoine Latter
On Fri, Apr 8, 2011 at 3:48 PM, Warren Harris warrensomeb...@gmail.com wrote: I'm trying out GHC-7.0.3-x86_64 for Mac OS X and see what seems to be a bug in System.Time.diffClockTimes. The TimeDiff tdPicosec field returns values that seem to jump around erratically: test = do  startTime -

Re: [Haskell-cafe] Testing Implementation vs Model - Records or Type Classes?

2011-04-08 Thread wren ng thornton
On 4/8/11 8:55 AM, Twan van Laarhoven wrote: -- this class is useful beyond this FRP library, -- you might already be able to find it on hackage somewhere class Functor f = Filterable f where filter :: (a - Bool) - f a - f a -- filter p . fmap f == fmap f . filter (p . f) -- filter (const True)

Re: [Haskell-cafe] Is there a way to find out the type inferred for a local function inside another function? :)

2011-04-08 Thread wren ng thornton
On 4/8/11 8:24 AM, Henning Thielemann wrote: Magnus Therning schrieb: AFAIK there is no way to do that, thouhg scion[1] may offer it. Personally I develop more complex local functions at the top-level, and once I'm happy with it I perform some re-factoring and move it in. I would not write

[Haskell-cafe] Patch: adding CTR, CMAC and SIV modes to the Crypto API

2011-04-08 Thread klondike
Hi, After a few weeks of hard work I have managed to add the CTR, CMAC and SIV modes of operation. The implemententation passes all the KATS I could find and is made as efficiently as possible without forgetting the risk of timing attacks over them. The patch is attached here and you can free it

Re: [Haskell-cafe] Is there a way to find out the type inferred for a local function inside another function? :)

2011-04-08 Thread Evan Laforge
I would not write large local functions at all. I would leave them top-level but do not export them. This also allows to test them from GHCi. The downside to this is when you want to use the worker/wrapper transform in order to capture some local variables for a recursive function, instead of