Re: [Haskell-cafe] what is wrong w my IORef Word32 ?

2013-07-18 Thread Taylor Hedberg
Joerg Fritsch, Thu 2013-07-18 @ 19:22:46+0200:
> Can I easily fix the modifyIORef statement by swapping "something" ?
> --Joerg

Replace `shiftL` with `flip shiftL` and change the type signature of
`sLbitfield` to take an Int instead of an Integer.


signature.asc
Description: Digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Quoting with template haskell

2013-07-17 Thread Taylor Hedberg
Jose A. Lopes, Wed 2013-07-17 @ 13:36:01+0200:
> I am quite new to template haskell and I am still trying to get the
> hang of it. How can I achieve something like the following Common Lisp
> code ?
> 
> `(,fn ,arg1 ,arg2)
> 
> Or is there a more Haskelley way of doing this ?

The naive translation would be:

[|$fn $arg1 $arg2|]

or, more explicitly:

appsE [fn, arg1, arg2]

`appsE` is from `Language.Haskell.TH`.


signature.asc
Description: Digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] LLVM Backend status

2013-06-27 Thread Taylor Hedberg
B B, Thu 2013-06-27 @ 20:55:57+0200:
> 2) How can I generate the LLVM IR (or bc) files from the compiler? I
> see that durign compilation with -fllvm -v3 flags the bc files are
> created but they are immidietly (after usage) deleted - Is it possible
> to tell the compiler not to delete them?

You can use the `-keep-llvm-files` option for this.


signature.asc
Description: Digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Promoting Haskell via Youtube movies

2013-06-17 Thread Taylor Hedberg
AlanKim Zimmerman, Mon 2013-06-17 @ 20:38:55+0200:
> This looks like quite a good series https://www.youtube.com/user/jekor

Seconded. I have really enjoyed his videos so far and it seems like he's
regularly producing more.


signature.asc
Description: Digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Getting a Hackage account

2013-06-08 Thread Taylor Hedberg
You might try just emailing him again (assuming you have not already
done that). When I signed up, he replied within a couple of hours. It
could be that your original message just slipped under the radar.


signature.asc
Description: Digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell/functional-language people in Raleigh/Durham, North Carolina, USA?

2013-04-16 Thread Taylor Hedberg
Benjamin Redelings, Tue 2013-04-16 @ 16:25:26-0400:
> I'm curious if there are any other people on this list who are
> interested in Haskell and functional languages in the Triangle Area,
> in North Carolina?

I am!

Funny you should ask, actually, as I was just wondering the same thing
myself earlier today.


signature.asc
Description: Digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Type classes, collections, sum types, closures, and a massive headache

2013-01-28 Thread Taylor Hedberg
If I understand your message well enough, I think you are looking for
GHC's `ExistentialQuantification` extension. Building heterogeneous
collections is a common example of what existential types are useful
for. Take a look at this wiki page [1]; there is an example of how to
accomplish this there, along with a handful of other techniques.


[1] 
http://www.haskell.org/haskellwiki/Heterogenous_collections#Existential_types


signature.asc
Description: Digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Virthualenv/HsEnv in Windows

2012-12-27 Thread Taylor Hedberg
Kyle Hanson, Mon 2012-12-24 @ 15:49:44-0600:
> Has anyone gotten this to work on Windows either native or on cygwin?
> Is there an alternative?

It may work on Cygwin, but I know for sure that it wouldn't run natively
on Windows, as part of hsenv's functionality involves generating and
executing bash scripts.

If you've tried it with Cygwin and it didn't work, maybe give some more
detail about the problems you're seeing. I am unable to try it out
myself as I don't have any Windows machines, but others might be able to
offer some insight.


signature.asc
Description: Digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-15 Thread Taylor Hedberg
Joel Burget, Fri 2012-09-14 @ 19:08:29-0700:
> I find the Monad instance for Maybe and Either very useful. You can do
> things like the following (which technically only uses the Applicative
> instance):
> 
> Prelude Control.Applicative> (*3) <$> (+2) <$> Just 1
> Just 9
> Prelude Control.Applicative> (*3) <$> (+2) <$> Nothing
> Nothing
> Prelude Control.Applicative> (*3) <$> (+2) <$> Left "error" :: Either String 
> Int
> Left "error"
> Prelude Control.Applicative> (*3) <$> (+2) <$> Right 1 :: Either String Int
> Right 9

Nitpick: You are using the Functor instances of Maybe and Either here,
not Applicative. (<$>) == fmap; it just happens to be defined in the
Control.Applicative module.


signature.asc
Description: Digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Compiling Haskell targetting different OS/arch

2012-08-24 Thread Taylor Hedberg
Thiago Negri, Fri 2012-08-24 @ 13:27:32-0300:
> Is it possible to compile Haskell code targetting a OS/arch that
> differs from the one where the compiler (GHC) is running?

No, GHC doesn't currently support cross-compilation.


signature.asc
Description: Digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Please critique my code (a simple lexer)

2012-05-22 Thread Taylor Hedberg
John Simon, Tue 2012-05-22 @ 10:13:07-0500:
> - My `consume` function seems basic enough that it should be library
> code, but my searches turned up empty. Did I miss anything?

consume = span . flip elem


> - Is creating data structures with simple field names like `kind`,
> `offset`, etc a good practice? Since the names are global functions, I
> worry about namespace pollution, or stomping on functions defined
> elsewhere.

If you don't intend your module to be imported and used as a library,
then there's no reason to worry about this. If you do intend it to be
used that way, then it's probably still not worth worrying about, as
name clashes can be resolved at the import level via qualified imports
or `hiding` lists. If it ends up really being a problem, you can always
add a namespace prefix to those names, though honestly I find that kind
of ugly.

The compiler will always catch cases of ambiguity caused by multiple
definitions of the same name being in scope, so you don't have to worry
about this causing inadvertent runtime bugs.


signature.asc
Description: Digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe