News aggregator

FP Complete: Stack entering stabilization phase

Planet Haskell - Fri, 11/06/2015 - 11:00pm

Since we created the stack repo at the end of April, a tremendous amount of work has been done very rapidly. Now that Stack has a suite of features that make it excellent for most common use cases, it's a good time to step back and work on improving the code-base to make future enhancements easier and more reliable. We'll do one or two new releases, and then enter a stabilization phase. In particular, this will include:

  • Refactoring build plan construction and execution
  • Eliminating code duplication
  • Properly integrate code that was copied/pasted from other projects
  • Spinning off non-Stack-specific helper modules into separate packages
  • More integration tests
  • Bug fixes
  • Performance optimization

During this period, minor pull requests with code cleanup, optimization, and additional tests will be gladly accepted, but please hold off on new features.

Some ways you can help:

  • File issues identifying duplicate and sub-optimal code, and other quality issues
  • Submit pull requests with code cleanup, optimization, and additional integration tests (stack test --flag stack:integration-tests enables them). Best to check first to avoid conflicts in code that is being overhauled.
  • Github issue triage

During this period, pull requests with new features are unlikely to be merged, so probably best to hold off to avoid a bunch of bitrotted PRs.

Some things we're working on before beginning the stabilization phase:

  • All-in-one package builds when there are no cyclic dependencies #1166
  • Docker integration: Remove need for custom entrypoint and phusion init in Docker images #531 #547
  • Allow global options both before and after command #519
Categories: Offsite Blogs

[cabal] Extract simple static information from PackageDescription

libraries list - Fri, 11/06/2015 - 9:38pm
Hello, I have a simple question regarding GenericPackageDescription/ PackageDescription. I don't understand it from the docs: Google and IRC #haskell also didn't help me. I am trying to extract a simple static information out of the cabal file: the hs-source-dirs Is there a way to get this without resolving conditionals, or with minimal effort? (I don't even understand how to resolving conditionals.) I tried it like this: But here the PackageDescription has no information (library == Nothing, executables == []). I appreciate any help so much. And I will release the program as an open-source example so that it may help other people in future. Thank you, Jakob
Categories: Offsite Discussion

Pattern matching with OverloadedLists

haskell-cafe - Fri, 11/06/2015 - 5:20pm
Hello Cafe, wiki for OverloadedLists says that g [x,y,z] = ... is treated as g (toList-> [x,y,z]) = Shouldn't this work? Both 'f's should be treated the same. f :: Text -> Int f (toList -> ('9':_)) = 1 -- OK f ('1':_) = 2 -- Couldn't match expected type ‘Text’ with actual type ‘[Char]’ (OverloadedStrings is also on) Am I missing something? br, vlatko _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

Conversant is hiring developers for a new Haskell team (Los Angeles, ON-SITE, Full-Time)

Haskell on Reddit - Fri, 11/06/2015 - 4:18pm

Join our newly formed team of crack commandos (there are only two of us at this point) tasked with replatforming a flaky data import / export system to Haskell (from Java). This is the first Haskell project at the company and we plan (pray?) to knock it out of the park.

The right candidate is either: A senior developer (JVM experience preferred) with a hobbyist's level of Haskell foo and a keen interest in Haskell's particular flavor of functional programming - or a junior/mid-career developer with strong Haskell skills.

Send me an email:

submitted by lasericus
[link] [10 comments]
Categories: Incoming News

User guide for DeriveAnyClass

haskell-cafe - Fri, 11/06/2015 - 11:01am
Is there a topic for DeriveAnyClass extension in user guide? It is mentioned several times in different places, also I see link to it in from cabal haddocs [0] into its page inside "other type extensions" [1], but it leads nowhere. Thank you. [0]: [1]: _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

Correct indentation in emacs, haskell-mode problem

Haskell on Reddit - Fri, 11/06/2015 - 9:34am

Hello everyone, I'm rather new to haskell and emacs is usally my editor of choice, everything worked pretty ok so far but I ran into the following issue:

Writing if-then-else expressions indents like this when hitting enter and creating a new line:

myAbs x = if x<0 then x*(-1) else x

when I use tab to "cycle" the indentation of 'then', I get the following, which will no longer change pressing tab again:

myAbs x = if x<0 then x*(-1) else x

Based on the Haskell Wikibook I assume it is supposed to look like this:

do first thing if condition then foo else bar third thing

So if I understand this correctly, bot possible indentations haskell-mode gives me are wrong? Is this intended from haskell-mode? If not, how do you achieve correct indentation in Emacs? Also, what is the correct way to indent if then else

Update: I think I do have a big confusion myself here, I now tried if within do and it formats it like in my last example. Are example #2 and example #3 correct?

submitted by worst_mathematician
[link] [13 comments]
Categories: Incoming News

Text or String

Haskell on Reddit - Fri, 11/06/2015 - 8:31am

When starting a new project, should I try to use only Text?

i.e. do not use String

submitted by alan_zimm
[link] [64 comments]
Categories: Incoming News

withState' - why doesn't this exist?

Haskell on Reddit - Thu, 11/05/2015 - 11:24pm

I've been finding scoped stateful computations useful - to compute a single state with StateT is fine and dandy, but what if you want to compute another stateful computation, that uses a different state type?

I really just want something like this combinator:

withState' :: (s1 -> s2) -> (s2 -> s1) -> StateT s2 m a -> StateT s1 m a withState' to from x = do now <- get let (y, now') = runState x (to now) put (from now') return y

Does something like this exist somewhere in the deep, dark corners of Hackage that nobody touches? :|

submitted by Spewface
[link] [11 comments]
Categories: Incoming News

How to install newest ghcjs-base

haskell-cafe - Thu, 11/05/2015 - 8:57pm
5 days ago a change [1] was made to the ghcjs-base library. How can one obtain a ghcjs that incorporates such a recent version of ghcjs-base? I installed ghcjs from git master yesterday, and installed the boot libraries using "ghcjs-boot --dev". However, I still get "Module ‘JavaScript.Web.MessageEvent’ does not export ‘getData’", so apparently my ghcjs-base lags behind somehow. What determines the version of ghcjs-base that is installed? Regards, Arie [1] <> _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

Where io-streams won't fit,comparing to conduit or pipes

haskell-cafe - Thu, 11/05/2015 - 6:33pm
Hello cafe, Now I'm preparing a presentatio for meetup for stream processing in functional programming(in Tokyo), and my part is something like "why stream processing library". While preparing material, I encountered the question that why io-streams is so simple comparing others, and the reason and downsides behind its simplicity. I'm guessing it's due to its resource handling strategy, but not so confident about it because I couldn't came up with a concrete example yet. Do you know any good example where io-streams won't fit? Let me know if you have. Thanks! _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

Best current way to install dev environment on a Mac?

Haskell on Reddit - Thu, 11/05/2015 - 4:32pm

I can't find a setup that I can get working.

I had a lot of failures installing haskell and cabal from Homebrew. I wasn't able to get all the ancillary pieces installed such as ghc-mod.

I'm also trying to get any of emacs, atom, or ST working with the relevant plugin. I got ST mostly working by cloning someone's unmerged branch, but I couldn't get all the haskell dependencies going.

Is GHC for Mac OSX the recommended way to go?

EDIT: GHC for Mac OSX doesn't work on El Capitan.

EDIT 2: GHC for Mac OSX can apparently work, but the current binary has been broken for a month. After installing, it's necessary to run stack install cabal-install.

EDIT 3: I can't stack install cabal-helper which is a requirement for ghc-mod and editor plugins. When building, it has an error loading a .so of some kind. Pretty long error trace.

submitted by dogweather
[link] [23 comments]
Categories: Incoming News

How did you get through the grind? Does this sound like a good approach?

Haskell on Reddit - Thu, 11/05/2015 - 4:17pm

Haskell noob here.

So I'm pretty sold on haskell being a good thing to know for a bunch of reasons. And by reading, I'm getting more reasons and becoming more familiar with the concepts. The problem is that I'm writing basically no code, just reading.

I'm a big fan of actually building things and I think to lock in the syntax and the concepts, and I need a decent project. I typically do web stuff, so I thought that would be a good choice. Basically, I'm not trying to do anything hard like make a compiler because I'd be struggling with an unfamiliar domain, syntax, and concepts all at once. At the same time, I don't want anything too superficial that won't encourage any repetition.

My thinking is that if I do something familiar and maybe even a bit repetitive, it will give me practice with the syntax and allow time for concepts to lock in.

Is this book (yesodweb) the way to go? I'm looking for the most stable framework to code against. It seems like this has the best docs and is the most stable. Good choice?

And back to the original question, how did you get through the grind? Willing to think outside the web if anyone has another compelling path.

submitted by tailanyways
[link] [28 comments]
Categories: Incoming News

Yampa: upcoming changes;maintaining the projects we care about

haskell-cafe - Thu, 11/05/2015 - 1:58pm
Dear all I am the current maintainer of the FRP implementation Yampa. (For context: I'm a PhD student at Nottingham, working with Henrik Nilsson.) Yampa contains legacy code that used to be useful to get things running quickly. In the interest of having minimal overhead and using existing robust solutions whenever possible, we'd like to remove some of that old auxiliary code. These changes will not affect the core of Yampa (SF definitions, arrow combinators, switches, etc.), but only auxiliary/miscelaneous stuff (vector spaces, deep strict evaluation type class, tupling/monad aux functions, etc.). We've been introducing these changes progressively over the last year, by first re-structuring the code base and marking some functions as deprecated. The time is coming for backwards incompatible changes, but I'd like to make sure that the projects you care about keep working as before. This may include (but is not limited to): * Code (which may not be on hackage, so it may be difficult for me to even know it
Categories: Offsite Discussion

No dynamic checks in StablePtr dereferences?

Haskell on Reddit - Thu, 11/05/2015 - 1:27pm

So, I just burned a lot of time debugging an issue that was caused by me passing an incorrect pointer from C back into Haskell -- a value with the wrong data type. Every guarantee I thought I was getting from GHC was violated, and I started getting back Data.Map's with billions of erroneous elements. When I asked about it in #GHC, they assumed it was a compiler bug on Windows (which I thought as well).

Anyway, it was totally my fault. But since Haskell is geared towards improving static assurances to prevent dumb programmers like me from shooting themselves in the foot: how could I have avoided these issues? How do you ensure that pointers are of the correct type when interfacing with foreign code? Is there an existing library that handles these dynamic checks for you?

submitted by basil-slap
[link] [3 comments]
Categories: Incoming News