News aggregator

Postdocs / Research Programmer for Efficient First-Class Automatic Differentiation

haskell-cafe - Wed, 01/15/2014 - 2:01pm
Postdocs / Research Programmer for Compositional Learning via Generalized Automatic Differentiation The goal of this project is to make a qualitative improvement in our ability to write sophisticated numeric code, by giving numeric programmers access to _fast_, _robust_, _general_, _accurate_ differentiation operators. To be technical: we are adding exact first-class derivative calculation operators (Automatic Differentiation or AD) to the lambda calculus, and embodying the combination in a production-quality fast system suitable for numeric computing in general, and compositional machine learning methods in particular. Our research prototype compilers generate object code competitive with the fastest current systems, which are based on FORTRAN. And the combined expressive power of first-class AD operators and function programming allows very succinct code for many machine learning algorithms, as well as for some algorithms in computer vision and
Categories: Offsite Discussion

Type-Level Instant Insanity

Haskell on Reddit - Wed, 01/15/2014 - 12:06pm
Categories: Incoming News

mdo with multiple values

haskell-cafe - Wed, 01/15/2014 - 11:57am
Dear List, a little puzzle. Given a monad M with a MonadFix instance, and these two functions: act1 :: T -> M () act2 :: a -> M T I morally want to write this function: foo :: [a] -> M () foo = mdo mapM_ act1 xs xs <- mapM act2 return () Unfortunately, that will not work: mapM_ will force xs before any of it can be generated. But morally it should be possible, as the lists passed to mapM_ and mapM have the same, already known list. So here is my solution (which is a bit more general, because I happen to need some that in one place): mapFstMapSnd :: MonadFix m => [(a -> m (), m a)] -> m () mapFstMapSnd xs = const () `liftM` go xs (return []) where go [] cont = cont go ((f,s):xs) cont = mdo f v (v:vs) <- go xs $ do vs <- cont v <- s return (v:vs) return vs Using that, I can write
Categories: Offsite Discussion

Yesod :: Homepage

del.icio.us/haskell - Wed, 01/15/2014 - 11:28am
Categories: Offsite Blogs

Philip Wadler: ADT and GADT implementations of simply-typed lambda calculus

Planet Haskell - Wed, 01/15/2014 - 10:15am
Lennart Augustsson posted a nifty description of a compiler from a simple expression language to LLVM that included a conversion from expressions represented as an ADT to expressions represented as a GADT. The ADT requires a separately implemented type checker, while the GADT piggybacks on Haskell's type system to ensure expressions are well typed. However, Lennart's expression language does not include lambda abstraction.

Based on Lennart's code, I implemented ADT and GADT versions of simply-typed lambda calculus with de Bruijn indices, integer constants, and addition, plus the conversion between them, without the distraction of compiling to LLVM. The code was cleaned and improved by Shayan Najd, and made publicly available via github. Thanks to Josef Svenningson for the pointer to Lennart's post.

Categories: Offsite Blogs

GHC API: runStmt not taking into account reloadedmodule

haskell-cafe - Tue, 01/14/2014 - 10:13pm
It's late here and I'm probably overlooking something stupid, so I'd like if somebody could put my nose on it... I'm using the GHC API to evaluate statements. I use runStmt to get a RunResult, lookupName to get the ID for the bound names, obtainTermFromId to get the term and showTerm to display it. So I can call a function from the loaded module with some parameters and get the result. Good! However, if I reload a module and I change the implementation of the function, runStmt still returns the old value! I know the reload worked because if I added new names, getNamesInScope returns the new names. What do I need to do to make sure the new function definitions are used? I've perused the source code of InteractiveEval and ghci but nothing stood out. I am calling setContext after load. Thanks a million!
Categories: Offsite Discussion

Implementing Type Classes

del.icio.us/haskell - Tue, 01/14/2014 - 6:46pm
Categories: Offsite Blogs

Implementing Type Classes

del.icio.us/haskell - Tue, 01/14/2014 - 6:46pm
Categories: Offsite Blogs

Releasing containers 0.5.3.2 -- before GHC 7.8?

libraries list - Tue, 01/14/2014 - 6:41pm
Hi guys, I'm wondering if we can do a hackage release of 0.5.3.2? That "splitRoot" function is in there, and my ability to deploy parallel code that uses containers depends on people getting it! Are there any other changes since 0.5.3.1? Replacing containers seems like a real pain for end users, so it would be great if 0.5.3.2 could come with GHC 7.8. Currently, it looks like the GHC repo is up to date in that it includes 0.5.3.1. I realize it is late days for this, but: - It's been a month since we put splitRoot in; I've been using it heavily and it I'm pretty confident that it's correct. (It's so simple!) - Nothing else is touched, so there is very little liability associated with this version bump. And, as you know, if we don't make this round it's a long latency before the next chance. That is, before we can expect people to do parallel folds over Data.Set or Data.Map without installation headache. Any objections? -Ryan _______________________________________________ Libraries ma
Categories: Offsite Discussion

Independent installations for testing

Haskell on Reddit - Tue, 01/14/2014 - 5:25pm

I want to test a library with multiple GHC configurations but don't have the resources to run many VMs at once. I'd like to have an arbitrary number of independent installations on each of the 3 big platforms. This way, I could test against multiple versions of the Haskell platform, the most recent versions of libraries, development versions of Haskell, etc. to ensure everything works. Are there any resources on this?

Thanks in advance.

submitted by MechaBlue
[link] [4 comments]
Categories: Incoming News

Feature request: Vacuous/error constraint (related to 7.7 closed type families regression)

glasgow-user - Tue, 01/14/2014 - 3:56pm
I was trying to fix one of my closed type families examples for the new syntax, and run into an unfortunate issue. Due to a kind error in my code one of my constraints was being silently discarded (see ticket: https://ghc.haskell.org/trac/ghc/ticket/8669) The main reason I resorted to this (in hindsight) ill-kinded hack is the lack of a vacuous (i.e. never holding) constraint to produce type errors. I would love to be able to explicitly force GHC into realising "this constraint can never hold", if I had the ability to pass along a String/Symbol to be reported to the user, that would be even better. Cheers, Merijn _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users< at >haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Categories: Offsite Discussion

Brent Yorgey: Catsters guide

Planet Haskell - Tue, 01/14/2014 - 3:06pm

tl;dr: http://byorgey.wordpress.com/catsters-guide-2/

In an attempt to solidify and extend my knowledge of category theory, I have been working my way through the excellent series of category theory lectures posted on Youtube by Eugenia Cheng and Simon Willerton, aka the Catsters.

Edsko de Vries used to have a listing of the videos, but it is no longer available. After wresting a copy from a Google cache, I began working my way through the videos, but soon discovered that Edsko’s list was organized by subject, not topologically sorted. So I started making my own list, and have put it up here in the hopes that it may be useful to others. Suggestions, corrections, improvements, etc. are of course welcome!

As far as possible, I have tried to arrange the order so that each video only depends on concepts from earlier ones. Along with each video you can also find my cryptic notes; I make no guarantee that they will be useful to anyone (even me!), but hopefully they will at least give you an idea of what is in each video.

I have a goal to watch two videos per week (at which rate it will take me about nine months to watch all of them); I will keep the list updated with new video links and notes as I go.


Categories: Offsite Blogs

Target Selection in HaRe

haskell-cafe - Tue, 01/14/2014 - 12:04pm
The Haskell Refactorer now makes use of the GHC API to load and typecheck the code to be refactored. It uses ghc-mod internally to identify a project cabal file, and extract the targets in it. The current code attempts to load all the targets into the module graph, to make sure that when a project is refactored the ancillary parts such as tests and benchmarks are refactored too, e.g. when renaming a function. The problem is that GHC is unable to load more than one main file. I am trying to decide on the best way of resolving this in terms of a user of HaRe, where it should 'just work' most of the time. The actual refactoring is done by calling the HaRe executable with command line arguments. Options that seem viable are 1. require the names of the target(s) to be loaded to be passed in as command line arguments. This means the IDE integration is going to have to provide a way of deciding the scope of the refactoring. 2. Create a config file that lives in the project directory and specifies the target
Categories: Offsite Discussion

Ask /r/haskell: how to implement a symbol table for a compiler in a purely functional language?

Haskell on Reddit - Tue, 01/14/2014 - 12:03pm

Hello everyone,

Last semester in school, I took a compiler construction class, and wrote a compiler for a small imperative language in Python. I've been meaning to try and write a compiler for an OO language, and also to do a larger project in Haskell. I thus decided to implement Alex Aiken's COOL language (see Coursera for more information) in Haskell.

So far, I have my lexer, parser and pretty printer and they work well. I'm now at the semantics analysis phase, but I'm not sure what would be a good way to implement a symbol table in Haskell. By that I mean, I'm not sure where the table should reside. Should it be a value that's computed once by a function and passed around to every other function that needs it? Should I put symbol information in the attribute field of my AST nodes?

If anyone has suggestions and/or reading material recommendations, I'd be very grateful.

gnuvince

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