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:
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'
| 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
-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)
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
() :: ()
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)
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:
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
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
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 -
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
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
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
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
___
*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
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
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
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
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
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,
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
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
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
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
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.
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,
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
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
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
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
30 matches
Mail list logo