News aggregator

Haskell IDE on Windows (source editing; project preparation and compiling/building)

Haskell on Reddit - Sun, 04/12/2015 - 12:39pm

I'm learning C++ at college ATM and using Visual Studio. Needless to say, it's a breeze; I only ever have to worry about the code and the dependencies between files. Everything else just works.

So I've become quite interested, very recently, in Haskell. In FP in general. Started out with messing with F# a bit and it intrigued me. Read around, went ahead and installed the Haskell Platform, and now I'm supremely stuck.

I can load/run separate .hs files through GHCi/runhaskell but otherwise, nothing works. Tried setting up several plugins, the last being several IntelliJ ones, but I can't for the life of me figure out how project handling works. Some sources speak of GHC and Cabal different build environments, of manually written make files and stuff like that...

I've yet to find a tutorial speaking a language I can understand. Using cabal init fails on the 3rd step with "Error: cabal: git: no source" or something like that.

Thanks a lot.

submitted by Enamex
[link] [44 comments]
Categories: Incoming News

Why there isn't a Pure typeclass ?

Haskell on Reddit - Sun, 04/12/2015 - 11:50am

An Applicative is a Functor with 2 functions, one to create an instance from a value (pure) and one to zip them (through <*>). However, I'm sure they are functors for which pure makes sense, but <*> doesn't. As now Applicative is a superclass of Monad, it would have make sense to also introduce a Pure class just defining pure?.

submitted by maxigit
[link] [78 comments]
Categories: Incoming News

[Announcement] FLTKHS - Bindings to the FLTK GUI Toolkit

Haskell on Reddit - Sun, 04/12/2015 - 9:49am

I'm pleased to announce the first release of Haskell bindings to the FLTK GUI toolkit.

It now works smoothly on Windows (64-bit), Linux and Mac allowing you to create truly cross-platform native GUI applications in pure Haskell and deploy statically linked executables with no dependencies.

Most of the FLTK API is covered except for a few minor widgets which I plan to get to in the next release.

Motivation behind the package and installation instructions are found in the Haddocks. And to get you started it ships with a number of demos.

If you have any issues please report them on the Github page.

I'd also love any other feedback so feel free to comment here or email me at the address listed on the Hackage page.

Hope you enjoy!

submitted by deech
[link] [9 comments]
Categories: Incoming News

Dealing with GHC 7.10 prelude imports

haskell-cafe - Sun, 04/12/2015 - 8:55am
Hi, I've run into a couple of cases when attempting to support multiple GHC versions in my libraries (7.6.3 -> 7.10) where I've repeatedly made mistakes due to being warned about unused imports for various modules that are now part of the Prelude such as Data.Monoid, Data.Foldable, etc. which I subsequently remove either manually or via editor automation sufficiently indistinguishable from magic. This then results in successful compilation on 7.10 and failure on earlier versions of GHC due to missing imports (ie. Data.Monoid (mappend, mempty)), which prior to my current workflow of manually building on multiple versions of GHC before releasing a new version, manifested once or twice only after uploading to Hackage. Now this is all user/workflow error on my part, but I wondered if others have some kind of trick up their sleeve for avoiding these kind of issues? I could attempt to tailor the compiler's warning flags appropriately, but it bodes ill for spotting genuinely unused imports. Cheers, Brendan ____
Categories: Offsite Discussion

Is there any way to compile this church number division combinator?

Haskell on Reddit - Sat, 04/11/2015 - 8:24pm

Mind the following program:

-- Conversion between int and church numerals intToChurch n f a = if n == 0 then a else f (intToChurch (n - 1) f a) churchToInt n = n (+ 1) 0 -- Church number division -- div = (\ v0 -> (\ v1 -> (\ v2 -> (\ v3 -> ((v1 (\ v4 -> (v4 v3))) ((v0 (((v1 (\ v4 -> (\ v5 -> (\ v6 -> (v4 (\ v7 -> ((v5 v7) v6))))))) (\ v4 -> v4)) (\ v4 -> (\ v5 -> (v5 (v2 v4)))))) (((v1 (\ v4 -> (\ v5 -> v4))) (\ v4 -> v4)) (\ v4 -> v4)))))))) -- Church number addition add = (\ v0 -> (\ v1 -> ((v1 (\ v2 -> (\ v3 -> (\ v4 -> (v3 ((v2 v3) v4)))))) v0))) main = do print (churchToInt (add (intToChurch 2) (intToChurch 3))) -- outputs 5 -- print (churchToInt (div (intToChurch 9) (intToChurch 3))) -- should output 3 ?

This should be self-descriptive: I have functions to convert between church numbers and ints and two functions which operate on church numbers, div and add. The add function compiles without issues, but the div function doesn't! I know, of course, it falls in the class of terms rejected by the type system. But, on this case, this is a perfectly valid function (which works, for example, on both JavaScript and Scheme without any issue) and I would like to use this function on Haskell. Is it possible to ask GHC to allow it?

submitted by SrPeixinho
[link] [6 comments]
Categories: Incoming News

SIMD

glasgow-user - Sat, 04/11/2015 - 5:44pm
What’s the story with this? I tried to follow the instructions here: https://ghc.haskell.org/trac/ghc/wiki/SIMD <https://ghc.haskell.org/trac/ghc/wiki/SIMD> but I get Dominic Steinitz dominic< at >steinitz.org http://idontgetoutmuch.wordpress.com _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
Categories: Offsite Discussion

What is the most hands-on way to learn Haskell?

Haskell on Reddit - Fri, 04/10/2015 - 9:07pm

I want to learn Haskell, and also build something useful with it. I started following the getting-started stackoverflow post and after reading Learn You a Haskell while testing things in ghci, I quickly started losing focus. I realized I was looking for something to actually code using Haskell and just overall looking for a more hands-on way of learning Haskell.

For anyone else who are very hands-on and learn-by-example type, how did you start getting into and later become proficient in Haskell? I am not new to functional programming, but I really want to learn Haskell, in a way where I can code more and read a little less.

submitted by wrahim
[link] [27 comments]
Categories: Incoming News

How do you debug programs?

Haskell on Reddit - Fri, 04/10/2015 - 7:23pm
Categories: Incoming News

What if Haskell won the lottery?

Haskell on Reddit - Fri, 04/10/2015 - 5:52pm

So, if the Glasgow Haskell Team won the lottery, (not a dinky $1.3 M prize, but really hit the jackpot with a payout of $5 Billion USD), how would that kind of windfall change the landscape for Haskell developers?

submitted by herbadah
[link] [108 comments]
Categories: Incoming News

Eta-reducing case branches

haskell-cafe - Fri, 04/10/2015 - 5:41pm
Has anyone ever considered permitting case branches to be eta reduced? For example, it is often nice to rewrite foo x = bar baz x as foo = bar baz Likewise, I have often wanted to rewrite case m of Nothing -> n Just x -> quux x as case m of Nothing -> n Just -> quux Am I missing an obvious reason this wouldn't work? Tom
Categories: Offsite Discussion

South of England Regional Programming Language Seminar programme finalised (30th April, Cambridge, attendance free)

Haskell on Reddit - Fri, 04/10/2015 - 4:14pm

The South of England Regional Programming Language Seminar (S-REPLS) is a regular and informal meeting for those based in the South of England with an interest in the semantics and implementation of programming languages.

Our first meeting is on April 30th at Wolfson College, Cambridge. Attendance is free, though we would appreciate prior notice by Wednesday 15th April (using the Doodle poll below) if you are going to attend.

We have now finalised our programme of talks. Our invited speaker is:

  • Conor McBride with a talk entitled The dependent lollipop.

Our volunteered talks are:

  • Jose Calderon with a talk entitled Improving implicit parallelism,
  • Alastair Donaldson with a talk entitled Many-core compiler fuzzing,
  • Laurence Tratt with a talk entitled Fine-grained language composition,
  • Tony Hoare with a talk entitled Graphical models of concurrent program execution.

More information on S-REPLS, including full abstracts for talks and information on how to get to Wolfson College, is available from the S-REPLS website here.

If you would like to attend, please leave your name in our Doodle poll before Wednesday 15th April.

submitted by dmulligan
[link] [2 comments]
Categories: Incoming News

Haskell on BBC Radio 4

haskell-cafe - Fri, 04/10/2015 - 2:00pm
Haskell featured strongly today in the last Episode of Radio 4's "Codes that changed the world": http://www.bbc.co.uk/programmes/b05prkh7 _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Proposal for a generic showIntAtBase

libraries list - Sun, 04/05/2015 - 5:46pm
Hi, The current implementation of showIntAtBase in Numeric is limited to Chars currently. *showIntAtBase* * :: (Integral a, Show a) => a -> (Int -> Char) -> a -> ShowS* The 2 reasons for this constraint is: a) We only accept functions of the form (Int -> Char) b) An implicit concatenation using (:) I'd like to propose a new function showIntAtBaseGeneric that removes the (Int -> Char) function constraint and takes an additional function to replace the implicit (:) operator. *showIntAtBaseGeneric* * :: (Integral a1, Num b, Show a1) =>* * a1 -> (b -> a) -> (a -> s -> s) -> a1 -> s -> s* Now showIntAtBase may be implemented as: *showIntAtBase :: (Integral a, Show a) => a -> (Int -> Char) -> a -> ShowS* *showIntAtBase base toChr n0 r0 = showIntAtBaseGeneric base toChr (:) n0 r0* The API and behavior of showIntAtBase remains unchanged while allowing for generic conversions not limited to Chars alone. *Example: * *λ> showIntAtBaseGeneric 26 id (:) 500 [] -- convert 500 to base26 and provid
Categories: Offsite Discussion

A Random Strawman

libraries list - Sat, 04/04/2015 - 6:57pm
Hello All, Having skimmed the literature, run some tests and benchmarks: The current System.Random is broken: https://github.com/haskell/random/issues/25#issuecomment-87423142. Furthermore, this is recorded in at least two published papers: http://dl.acm.org/citation.cfm?id=2660195 and http://publications.lib.chalmers.se/records/fulltext/183348/local_183348.pdf. The tf-random package does not have this breakage and is based on good theoretical foundations. In my tests tf-random performs better than System.Random. As a result of which, I am very much inclined to suggest we replace the code in System.Random with tf-random. Before doing any more work on this, I’d like to understand what the next steps should be. How much review should be carried out? I have no reason to doubt the implementors have done a great job but should someone (who?) review the code more formally. If so what would the process / tools be? Tests in packages / applications may now fail as the (pseudo) random numbers will be different w
Categories: Offsite Discussion

New gtk2hs 0.12.4 release

gtk2hs - Wed, 11/21/2012 - 12:56pm

Thanks to John Lato and Duncan Coutts for the latest bugfix release! The latest packages should be buildable on GHC 7.6, and the cairo package should behave a bit nicer in ghci on Windows. Thanks to all!

~d

Categories: Incoming News