Re: [Haskell-cafe] Probably type checker error.

2011-06-20 Thread Corey O'Connor
Not just a proposal any more. :-) GHC 7.0 does not generalize local let bindings in some situations. See here for information: http://hackage.haskell.org/trac/ghc/blog/LetGeneralisationInGhc7 There is a proposal (from Big Simon) to remove let-generalization:

[Haskell-cafe] Conditional IO ?

2011-06-20 Thread Dmitri O.Kondratiev
Hi, What is right way to do conditional IO? For example, I need to write to file errors only in case they exist, otherwise my function should do nothing: handleParseErrors errors | (not . null) errors = writeFile parse-errors.txt (show errors) | otherwise = ? What should be an 'otherwise'

Re: [Haskell-cafe] Conditional IO ?

2011-06-20 Thread Eugene Kirpichov
| otherwise = return () or: handleParseErrors errors = when (not . null $ errors) $ writeFile . 2011/6/20 Dmitri O.Kondratiev doko...@gmail.com: Hi, What is right way to do conditional IO? For example, I need to write to file errors only in case they exist, otherwise my function should

Re: [Haskell-cafe] Conditional IO ?

2011-06-20 Thread Arlen Cuss
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 20/06/11 18:00, Dmitri O.Kondratiev wrote: Hi, What is right way to do conditional IO? For example, I need to write to file errors only in case they exist, otherwise my function should do nothing: handleParseErrors errors | (not . null)

Re: [Haskell-cafe] Conditional IO ?

2011-06-20 Thread Lyndon Maydwell
Your errors branch has the type writeFile parse-errors.txt (show errors) :: IO () This means that your otherwise branch should have the same type. You can use the return function that has the type return :: Monad m = a - m a specialised to m = IO in conjunction with the value () :: ()

Re: [Haskell-cafe] Conditional IO ?

2011-06-20 Thread Dmitri O.Kondratiev
Thanks! Everything works, and 'when' is really nice. ( I still have only basic monad knowledge, need more time to spend on existing libraries) On Mon, Jun 20, 2011 at 12:14 PM, Lyndon Maydwell maydw...@gmail.comwrote: Your errors branch has the type writeFile parse-errors.txt (show errors)

Re: [Haskell-cafe] Probably type checker error.

2011-06-20 Thread MigMit
Yeah, seems to work too. Отправлено с iPhone Jun 20, 2011, в 10:55, Corey O'Connor coreyocon...@gmail.com написал(а): Not just a proposal any more. :-) GHC 7.0 does not generalize local let bindings in some situations. See here for information:

Re: [Haskell-cafe] Probably type checker error.

2011-06-20 Thread Serguey Zefirov
The fact is that (Num a) context works and (ToWires a, Num a) context doesn't. At least in 6.12.1. This still looks to me like a bug. 2011/6/19 Miguel Mitrofanov miguelim...@yandex.ru: Seems like let-generalization is at work here. Types of all values in the where section are inferred

[Haskell-cafe] Data Flow Programming in FP

2011-06-20 Thread Richard Senington
Hi all, I have recently become interested in Dataflow programming and how it related to functional languages. I am wondering if the community has any advice on reading matter or other directions to look at. So far I have been looking through the FRP libraries, using Haskell functions with

Re: [Haskell-cafe] Text.CSV questions

2011-06-20 Thread Alejandro Serrano Mena
Maybe you can directly distinguish if the parser returned an error (Left) or not (Right), instead of using lefts and rights: import Text.CSV import Data.Either import System import Data.List main = do [inpFileName] - getArgs putStrLn (Parsing ++inpFileName++...) result -

Re: [Haskell-cafe] Data Flow Programming in FP

2011-06-20 Thread David Barbour
On Mon, Jun 20, 2011 at 7:45 AM, Richard Senington sc06...@leeds.ac.ukwrote: I have recently become interested in Dataflow programming and how it related to functional languages. I am wondering if the community has any advice on reading matter or other directions to look at. So far I have

Re: [Haskell-cafe] Text.CSV questions

2011-06-20 Thread Dmitri O.Kondratiev
On Mon, Jun 20, 2011 at 7:30 PM, Alejandro Serrano Mena trup...@gmail.comwrote: Maybe you can directly distinguish if the parser returned an error (Left) or not (Right), instead of using lefts and rights: import Text.CSV import Data.Either import System import Data.List main = do

Re: [Haskell-cafe] Probably type checker error.

2011-06-20 Thread David Menendez
GHC 6.12 introduces MonoLocalBinds, which disables polymorphic values in let statements. Your original code works for me if I use -XNoMonoLocalBinds -XNoMonomorphismRestriction. On Mon, Jun 20, 2011 at 9:02 AM, Serguey Zefirov sergu...@gmail.com wrote: The fact is that (Num a) context works and

[Haskell-cafe] Software patents covered in GHC?

2011-06-20 Thread Shakthi Kannan
Hi, I would like to know if there are any software algorithms used in the Glasgow Haskell Compiler that have been patented? If yes, in which countries do they apply? Just curious to know. SK -- Shakthi Kannan http://www.shakthimaan.com ___

Re: [Haskell-cafe] Software patents covered in GHC?

2011-06-20 Thread austin seipp
*sigh* CC'ing to the rest of haskell-cafe for completeness. I need to change 'reply all' to a default in my email I guess. On Mon, Jun 20, 2011 at 12:19 PM, austin seipp a...@hacks.yi.org wrote: Hello, Realistically, there probably is. Considering everything down to linked lists are patented

Re: [Haskell-cafe] Conditional IO ?

2011-06-20 Thread Henk-Jan van Tuyl
On Mon, 20 Jun 2011 10:33:14 +0200, Dmitri O.Kondratiev doko...@gmail.com wrote: Thanks! Everything works, and 'when' is really nice. ( I still have only basic monad knowledge, need more time to spend on existing libraries) See A tour of the Haskell Monad functions[0]. Regards, Henk-Jan

[Haskell-cafe] Text report tools?

2011-06-20 Thread Dmitri O.Kondratiev
Hi, I am looking for an easy way to generate text reports. For starters I need a very simple report that may contain: - Some headers - Lists of text strings where each string can include instances of basic Haskell types. Each string should be printed on a separate line (terminated with LF). Do I

Re: [Haskell-cafe] Text report tools?

2011-06-20 Thread Gregory Collins
Try http://hackage.haskell.org/package/HStringTemplate. G On Mon, Jun 20, 2011 at 2:27 PM, Dmitri O.Kondratiev doko...@gmail.com wrote: Hi, I am looking for an easy way to generate text reports. For starters I need a very simple report that may contain: - Some headers - Lists of text

Re: [Haskell-cafe] Conditional IO ?

2011-06-20 Thread David Barbour
On Mon, Jun 20, 2011 at 1:33 AM, Dmitri O.Kondratiev doko...@gmail.comwrote: Thanks! Everything works, and 'when' is really nice. ( I still have only basic monad knowledge, need more time to spend on existing libraries) I heavily use 'when' and 'unless'. ('unless b x' is the same as 'when

[Haskell-cafe] ANNOUNCEMENT: TinyLaunchbury 1.0.1

2011-06-20 Thread Elliot Stern
Sankel Software is pleased to announce the release of TinyLaunchbury 1.0.1 [1], a small implementation of John Launchbury's natural semantics for call-by-need. We hope that is is useful in helping to understand how call-by-need works. There is also a new blog post[2], explaining the semantics,

Re: [Haskell-cafe] Probably type checker error.

2011-06-20 Thread Serguey Zefirov
Thank you very much. I'll try that too. 2011/6/20 David Menendez d...@zednenem.com: GHC 6.12 introduces MonoLocalBinds, which disables polymorphic values in let statements. Your original code works for me if I use -XNoMonoLocalBinds -XNoMonomorphismRestriction. On Mon, Jun 20, 2011 at 9:02

Re: [Haskell-cafe] Probably type checker error.

2011-06-20 Thread Miguel Mitrofanov
Defaulting. Inferred type of r is still polymorphic – r :: E ins outs – but type of x, nextSum and currentSum is defaulted to Integer. Try adding default () to your program, and you'll see the same error again. Or, if you enable NoMonomorphismRestriction (or MonoLocalBinds – I didn't know it

[Haskell-cafe] Job position for haskell/clojure dev. in San Dimas, CA

2011-06-20 Thread vagif . verdi
Anyone interested in full time employment working with haskell and clojure in San Dimas, CA (local job only, NO telecommute) please let me know. Regards, Vagif Verdi ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Opaque types vs automated instance deriving

2011-06-20 Thread Alexey Karakulov
Hi all, I encountered a problem when trying to derive makeBinary ''DiffTime with help of *derive* package. The error was: Not in scope: data constructor `MkDiffTime' Which makes a sense, since it's not exported in Data.Time.Clock. I bypassed the problem (yes, I'm too lazy to write instances

Re: [Haskell-cafe] Text report tools?

2011-06-20 Thread Ivan Lazar Miljenovic
On 21 June 2011 04:27, Dmitri O.Kondratiev doko...@gmail.com wrote: Hi, I am looking for an easy way to generate text reports. For starters I need a very simple report that may contain: - Some headers - Lists of text strings where each string can include instances of basic Haskell types. 

[Haskell-cafe] AusHac2011 - The Australasian Haskell Hackathon - July 8-10

2011-06-20 Thread Alex Mason
It's almost that time of year again! Next month is the second annual AusHac event, at UNSW in Sydney, and you are invited! But if you want to come, we need to hear from you soon, as we need to organise access to the university network for you. If you're an Australian Haskell hacker, enthusiast,

Re: [Haskell-cafe] Job position for haskell/clojure dev. in San Dimas, CA

2011-06-20 Thread Vagif Verdi
Sorry, forgot to mention, and i already got questions about it. No worker visa sponsorship, no relocation from abroad. US only. On Jun 20, 2:39 pm, vagif.ve...@gmail.com wrote: Anyone interested in full time employment working with haskell and clojure in San Dimas, CA (local job only, NO

Re: [Haskell-cafe] Software patents covered in GHC?

2011-06-20 Thread Manuel M T Chakravarty
austin seipp: *sigh* CC'ing to the rest of haskell-cafe for completeness. I need to change 'reply all' to a default in my email I guess. On Mon, Jun 20, 2011 at 12:19 PM, austin seipp a...@hacks.yi.org wrote: Hello, Realistically, there probably is. Considering everything down to linked

Re: [Haskell-cafe] Haskell *interpreter* on iPad? (Scheme and Ocaml are there)

2011-06-20 Thread Manuel M T Chakravarty
And while we are dreaming, in an iOS port of GHCi (meaning GHCi runs on iOS and doesn't just generate code for it), it would be great to make bytecode persistent — ie, the bytecode that GHCi currently generates internally to interpret programs should be serialized to save and load it. (Note

Re: [Haskell-cafe] Opaque types vs automated instance deriving

2011-06-20 Thread Antoine Latter
On Mon, Jun 20, 2011 at 5:07 PM, Alexey Karakulov ankaraku...@gmail.com wrote: Hi all, I encountered a problem when trying to derive makeBinary ''DiffTime with help of derive package. The error was: Not in scope: data constructor `MkDiffTime' Which makes a sense, since it's not exported