News aggregator

Hiding platform packages in Cabal sandboxes

haskell-cafe - Wed, 10/15/2014 - 2:07pm
As a maintainer of the various OpenGL-related packages I have the following problem: The Haskell platform has those packages (OpenGLRaw, GLURaw, ...) exposed, which is the right thing to do in general. When I want to work on those packages, I'd like to use Cabal sandboxes to avoid screwing up the platform versions of them, but things get a bit tricky then. Consider e.g. the GLURaw package, which depends on the OpenGLRaw package. Assume that I'd like to add some stuff to the OpenGLRaw package and use that in GLURaw. With cabal sandboxes I'll have to fight a little bit, because versions of these packages are already exposed: ----------------------------------------------------------------------------------------------------------------------- svenpanne< at >svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal sandbox init Writing a default package environment file to /usr/local/google/home/svenpanne/repos/haskell-packages/GLURaw/cabal.sandbox.config Creating a new sandbox at /usr/local/google/home/svenpanne/re
Categories: Offsite Discussion

Stepping through a huge Haskell codebase

Haskell on Reddit - Wed, 10/15/2014 - 2:00pm

I'm trying to step through the ghc (Haskell Compiler) codebase, which is huge.

  • What is the best way to step through a huge Haskell codebase ?
  • What tools could help with this task ?
  • Are there any tools like Visual Studio debugging ? (which I use when ramping up on huge C# projects)
  • Is there a better way than to put 'trace' statements all over the code ?

It seems like 'trace' debugging and breaking things into tiny bits of functions is fine when I'm the one developing code bit by bit. But I find that model to be not that great when I want to understand some huge codebase and run the app, stop it at points and examine its behavior at runtime (like Visual Studio debugging).

submitted by attilah
[link] [15 comments]
Categories: Incoming News

Douglas M. Auclair (geophf): September 2014 1HaskellADay problems and solutions

Planet Haskell - Wed, 10/15/2014 - 11:36am

September, 2014
  • September 1st, 2014: They tried to kill the Metal...I don't know where I'm going with that. But rock-n-roll with today's #haskell exercise http://lpaste.net/110331
  • September 2nd, 2014: Good morning! Triangle Sums is our #haskell problem for today: http://lpaste.net/110404 No triangles were harmed in the solution of their sum (nor in the summation of their solution) http://lpaste.net/110432

  • September 3rd, 2014: Pay It Forward. What? You didn't think I'd just say: today's #haskell problem is hard and leave it at that, did you? http://lpaste.net/110444 Paid. Or: a constructivist approach reduces the generated sets from 200M+ down to 8 possible solutions http://lpaste.net/110684 That's doable. ... and here is the 'Mr. Clean' version of the solution: fast, and neat. Groovy! http://lpaste.net/110685
  • September 4th, 2014: Today's #haskell problem: Abacus words http://lpaste.net/110494 because MRFE says "I don't like your math problems; I want more word problems"
  • September 5th, 2014: These 'edgy' relationships these days!  Remember when today's #haskell problem didn't involve graph theory? http://lpaste.net/110543 Data.Graph FTW! http://lpaste.net/110571 A solution to today's 4sum #haskell problem, and it didn't require generating 1625702400 solutions!
  • September 8th, 2014: We have puzzles 1 and 5 from the "Montley Stew" problem set for today's #haskell problem http://lpaste.net/110699 The solution-style to Montley Stew isswimming in list-compression stew http://lpaste.net/110750
  • September 9th, 2014: King Tut! http://lpaste.net/110789 Our #haskell problem for today is NOT a Pyramid Scheme. Maybe.
  • September 10th, 2014: 'Sed' is 'but(t)' just another word ... in "'laddin" http://lpaste.net/110833 Today's #haskell problem is mix-n-match words. "But(t) I sed ..." ARG! Enough with the 3rd-grade humor! On with the solution to the mix-n-match words! http://lpaste.net/110859
  • September 11th, 2014: A-plus for you when you solve today's #haskell exercise http://lpaste.net/110862 But an F- (NOT an F# ... geddit?) for /usr/share/dict/words :/ A solution to today's injectInto #haskell problem http://lpaste.net/110891
  • September 12th, 2014: Today's #Haskell problem comes from She. She who commands you solve it before coding it. http://lpaste.net/110925 So, you know: there it is. Okay, 'thurt' is a word in WHICH Universe? A solution to today's #haskell 'ditto' problem http://lpaste.net/110955
  • September 15th, 2014: "The name of the game is Connect Four!" and today's #haskell problem http://lpaste.net/111065 as suggested by a tweet from @DrEugeniaCheng. I played Connect 4 against myself and lost! :/ A semi-solution to today's #haskell problem at http://lpaste.net/111105

  • September 16th, 2014: There's more than one way to slice and dice a matrix for today's #haskell problem http://lpaste.net/111109 (follow-up to yesterday's Connect4) A Hack-n-slash solution to today's diagonal view of matrices. http://lpaste.net/111130 Thebonus solution is provided back at the Connect Four answer to make that game complete: http://lpaste.net/111105
  • September 17th, 2014: Do you Yahoo!? Today's #haskell problem: connecting to Yahoo!'s financial webservice http://lpaste.net/111071 I like my java GREEN! http://lpaste.net/111238 (java means 'coffee') A solution to stock webservice #haskell problem.

  • September 18th, 2014: Star (Tuna?) Fish? http://lpaste.net/111216 A radial word-finding/matching game is today's #haskell puzzle. Wait. Quantum...WHAT? http://lpaste.net/111259 A solution to today's #haskell problem using quantum superpositions to solve it. I'm not joking. STAR POWER! http://lpaste.net/edit/111259 A solution for pretty-printing the star-puzzle
  • September 19th, 2014: Continued fractions and dual inversionals are today's #haskell problem http://lpaste.net/111067 It even comes with (thoughts about) flowers. #Ult Today's problem was inspired by a comment, then the main article, from @aperiodicalhttp://aperiodical.com/2013/11/from-the-mailbag-dual-inversal-numbers/#comment-611141 That was some LOOOOOOOONG Division! http://lpaste.net/111314 A solution to today's #haskell problem.
  • September 22nd, 2014: Oh, noes! The 'M'-word! http://lpaste.net/111419 for today's #haskell exercise. Project Eulerproblem 11'M' is for 'Monoid' http://lpaste.net/111435 A solution to today's #haskell problem.
  • September 23rd, 2014: "Oh, the snark bites, with his teeth, dear." MACD Knife ... geddit? http://lpaste.net/111468 Today's #haskell problem is a technical indicator.
  • September 24th, 2014: Jones, Smith, and Brown work at the Bank... but not Mr. Banks.A logic puzzle from 1957 for today's #haskell puzzle http://lpaste.net/111461. A pair of PhDs (http://lpaste.net/111580) helped to solve today's #haskell problem. Neatly, too, I might add.
  • September 25th, 2014: Corned-beef hashi? http://lpaste.net/111452 No, that's not right, and now I'm hungry! :( Shoot! Well, anyway: today's #haskell problem.
  • September 26th, 2014: HA! I TOLD you we'd be getting to cipher-text! http://lpaste.net/111459 From the 1700's, still: it IS cipher text for today's #haskell problem. Ooh! The Plot Thickens (like pea soup)! http://lpaste.net/111679 "ALLMENHAVING" and "be mis T r U st ed " is a solution to today's problem.
  • September 29th, 2014: Big (Crypto) Generator! http://lpaste.net/111795 Today's #haskell problem is a follow-on to Friday's. Human Error ... WHAT human error?http://lpaste.net/111829 A solution to today's make-your-own-cypto-table #haskell problem
  • September 30th, 2014: "I wanna be a blue-collar man!" Yes, but who, and which occupation? http://lpaste.net/111755 Today's #haskell problem addresses this. Plumber, ... or painter? IDK! http://lpaste.net/111876 TWO-solutions to today's #haskell problem (one of them MAY be correct... :/ )
Categories: Offsite Blogs

Foreign function interface to an OCaml library

Haskell on Reddit - Wed, 10/15/2014 - 7:20am

I am interested in using an OCaml library in Haskell. Is that at all possible? Any resources of building an FFI? Or am I better off reimplementing the library?

submitted by haskool
[link] [5 comments]
Categories: Incoming News

Show /r/haskell: Parser for the TOML configuration file format

Haskell on Reddit - Wed, 10/15/2014 - 6:47am

Hi all.

I've just "kind of" finished a parser for the TOML configuration file format, and published it on Github. It is based on a toml-parser I found on Hackage, but I rewrote most of it in the process of making it compliant with the latest (v0.2.0) specification of TOML.

Since it is my first public-consumption-lib in Haskell (hope to publish it on Hackage and all), I want to ask for feedback here. Anything advice/critique/etc. is welcome.

The meat of the project is in these files: Types.hs and Parser.hs.

The Parser is, IMHO, pretty straight forward. I still want to look into a way to produce more helpful errors.

The Types are also quite straight forward, except for the insert function which is used to build TableNode trees; it deals with all the edge cases. I tried to simplify this code with an Evaluator monad as described here, but that only reduced about two lines of code, while needing monad+applicative+functor declarations.

In toml-arrays are not allowed to have mix-type content. At first I wanted to used Haskell's type-system to enforce this (even raised a question about this on StackExchange), but I ended up with a solution in the Parser (see the array and arrayOf functions in Parser.hs).

As explained in the project's README I want to look into the following:

  • using Lenses to ease pulling data from the TomlDoc data structure
  • getting more helpful error messages out of Attoparsec
  • using QuickCheck to test (but I dont know if that makes sense as I only supply a parser-from- and no serializer-to-Toml)

Any thoughts on these topics?

I hope it is a useful contribution, I certainly enjoyed working on it. Haskell starts to make ever more sense after having intoxicated myself for many years with Ruby's open-class-OO and duck-typing.

submitted by cies010
[link] [18 comments]
Categories: Incoming News

common imports

del.icio.us/haskell - Tue, 10/14/2014 - 10:32pm
Categories: Offsite Blogs

common imports

del.icio.us/haskell - Tue, 10/14/2014 - 10:32pm
Categories: Offsite Blogs

status of rebindable syntax for arrows

glasgow-user - Tue, 10/14/2014 - 9:26pm
The GHC manual already for quite a number of version states: • Arrow notation (see Section 7.17, “Arrow notation ”) uses whatever arr, (>>>), first, app, (|||) and loop functions are in scope. But unlike the other constructs, the types of these functions must match the Prelude types very closely. Details are in flux; if you want to use this, ask! When using this feature we get the error: "Var/Type length mismatch: [s{tv aVL} [tv]] [] ghc: panic! (the 'impossible' happened) (GHC version 7.8.3 for x86_64-apple-darwin): tcTyVarDetails s{tv aVL} [tv] Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug" So our question is whether we should really report this as a bug, and/or what we can do about this. Thanks for your help, Doaitse
Categories: Offsite Discussion

ANN: yi-0.10.0 , the text editor written in Haskell

General haskell list - Tue, 10/14/2014 - 7:05pm
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 We're glad to announce Yi 0.10.0. Yi is 10 years old today! Our main repository is at [1]. Yi compiles with GHC 7.6.3 all the way up to GHC 7.8.3. There have been many changes since the latest Hackage release (0.8.2). I inline the relevant part of the changelog at the bottom. We are slowly trying to populate the documentation pages: we have recently started using GitHub pages[2] for this purpose. Please have a look! On top of the issues listed in the changelog, a lot of issues were closed separately. If you had a pending issue, please check the issue tracker. As always we're looking for contributors: we have tasks in just about any area. Note that you don't even need to know Haskell to help us. Visit us on #yi on Freenode: be prepared to stay for more than 5 minutes. Installation instructions are available at [2]. If you're using nix, Yi 0.10.0 will be packaged shortly. 0.10.0 - ------ * Unicode syntax highlighting fixed (issue #82) * Hook to GTK Wind
Categories: Incoming News

optimizing StgPtr allocate (Capability *cap, W_ n)

glasgow-user - Tue, 10/14/2014 - 6:08pm
Hello Glasgow-haskell-users, i'm looking a the https://github.com/ghc/ghc/blob/23bb90460d7c963ee617d250fa0a33c6ac7bbc53/rts/sm/Storage.c#L680 if i correctly understand, it's speed-critical routine? i think that it may be improved in this way: StgPtr allocate (Capability *cap, W_ n) { bdescr *bd; StgPtr p; TICK_ALLOC_HEAP_NOCTR(WDS(n)); CCS_ALLOC(cap->r.rCCCS,n); /// here starts new improved code: bd = cap->r.rCurrentAlloc; if (bd == NULL || bd->free + n > bd->end) { if (n >= LARGE_OBJECT_THRESHOLD/sizeof(W_)) { .... } if (bd->free + n <= bd->start + BLOCK_SIZE_W) bd->end = min (bd->start + BLOCK_SIZE_W, bd->free + LARGE_OBJECT_THRESHOLD) goto usual_alloc; } .... } /// and here it stops usual_alloc: p = bd->free; bd->free += n; IF_DEBUG(sanity, ASSERT(*((StgWord8*)p) == 0xaa)); return p; } i think it's obvious - we consolidate two if's on the crirical path into the single one
Categories: Offsite Discussion

Check for non-Member of an OpenUnion

Haskell on Reddit - Tue, 10/14/2014 - 4:25pm

extensible-effects includes a class, Member, for checking whether a type is present in a sum-type built up with :>

http://hackage.haskell.org/package/extensible-effects-1.7.1/docs/Data-OpenUnion1.html#Member

Is there a way to check whether a type is not present in the sum-type?

submitted by markandrus
[link] [3 comments]
Categories: Incoming News