News aggregator

Apologies

libraries list - 0 sec ago
I want to apologize to wren (and everybody else). I was tired and overreacted when the discussion started veering into making more breaking changes. I don't mind the Foldable changes too much. My main concerns are: * loss of monomorphism makes teaching more difficult * They can be generalized in other useful ways However, I don't consider those concerns show-stoppers.
Categories: Offsite Discussion

foldable flexible bridges (putting foldable+traversable in prelude)Re: Burning bridges

libraries list - 0 sec ago
lets see what concerns there are 1) will any code break? Nope! In fact, it's trivial to provide a shim that only exposes the list monomorphic versions. 2) does the change make learning the language more challenging? No. In fact, i've encountered *many* more smart people getting confused as to why the map / fold etc in prelude are all list specific than i've seen people struggle with type classes. The various list specific versions of the foldable codes actually **confuses** smart software folks who are starting to learn haskell for fun. I can't explain to a smart engineer *any* reason why minimum :: Ord<http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Ord> a => [a] -> a exists in prelude. I *can* explain why something like minimum :: (Foldable<http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Foldable.html#t:Foldable> t, Ord<http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Ord.html#t:Ord> a) => t a -> a would be useful and deserving of being in the
Categories: Offsite Discussion

ICSM 2013 - CFP for ERA/Tool Demo/DoctoralSymposium/Industry Tracks

============================================================================ ICSM 2013 CFP - ERA/Tool Demo/Doctoral Symposium/Industry Tracks ============================================================================ 29th IEEE International Conference on Software Maintenance 22 - 28 September 2013 - Eindhoven, The Netherlands http://icsm2013.tue.nl/ Follow us on Twitter: < at >IEEEICSM ============================================================================ The deadline for the ERA/Tool Demo/Doctoral Symposium/Industry tracks is approaching! Please read below and refer to the web page for further information. ================================ IMPORTANT DATES ================================ Abstract submission: June 17, 2013 Full papers submission: June 24, 2013 Notification: July 26, 2013 Camera-ready: August 9, 2013 ================================ ERA Track ================================ The goal of the Early Research Achievements (ERA) track is to provide researchers and practitioners with a f
Categories: Incoming News

ghc-mod v2.0.1

haskell-cafe - 0 sec ago
Hi cafe! I have released ghc-mod v2.0.1. From this version, ghc-mod provides the ghc-mod library in addition to the ghc-mod command: http://hackage.haskell.org/package/ghc-mod http://mew.org/~kazu/proj/ghc-mod/en/ Enjoy! --Kazu
Categories: Offsite Discussion

Haskell Platform 2013.2.0.0 Windows installer RC1

libraries list - 54 min 50 sec ago
Hi all, I've uploaded the RC1 2013.2.0.0 release candidate installer to http://code.haskell.org/~refold/HaskellPlatform-2013.2.0.0-rc1-setup.exe SHA1: fe9a4eee2fe8839eb3b240f15a2af229a110e37f What's new in 2013.2.0.0-rc1: * Updated versions of all packages Known issues: * OpenGL-related libraries are compiled without -split-objs because of GHC performance issues. * Also see http://trac.haskell.org/haskell-platform/wiki/Windows Unless someone finds serious bugs in this RC, it can be released unchanged. Enjoy!
Categories: Offsite Discussion

Failure deriving MonadRWS when using a type-family for the State part

haskell-cafe - Mon, 05/20/2013 - 11:08pm
All, The following code results in a compilation error (I tried GHC 7.4.1 & a 7.7.20130430 build): {-# LANGUAGE TypeFamilies, GeneralizedNewtypeDeriving, StandaloneDeriving #-} module Main where import Control.Applicative import Control.Monad.RWS data C = C data E = E data S1 = S1 Int type family I a :: * type instance I S1 = Int newtype T a s m r = T { unT :: RWST C [E] (I s) m r } deriving ( Functor , Applicative , Monad , MonadReader C , MonadWriter [E] , MonadState (I s) , MonadRWS C [E] (I s) , MonadTrans ) Error: No instance for (MonadState (I s) (T a s m)) arising from the 'deriving' clause of a data type declaration Possible fix: use a standalone 'deriving instance' declaration, so you can specify the instance context yourself When deriving the instance for (MonadRWS C [E] (I s) (T a s m)) Commenting out the MonadRWS line from the derivings lis
Categories: Offsite Discussion

wren ng thornton: Upcoming talk

Planet Haskell - Mon, 05/20/2013 - 4:11pm

Next month I'll be giving a talk at the NLCS workshop, on the chiastic lambda-calculi I first presented at NASSLLI 2010 (slides[1]). After working out some of the metatheory for one of my quals, I gave more recent talks at our local PL Wonks and CLingDing seminars (slides). The NASSLLI talk was more about the linguistic motivations and the general idea, whereas the PLWonks/CLingDing talks were more about the formal properties of the calculus itself. For NLCS I hope to combine these threads a bit better— which has always been the challenge with this work.

NLCS is collocated with this year's LICS (and MFPS and CSF). I'll also be around for LICS itself, and in town for MFPS though probably not attending. So if you're around, feel free to stop by and chat.

[1] N.B., the NASSLLI syntax is a bit different than the newer version: square brackets were used instead of angle brackets (the latter were chosen because they typeset better in general); juxtaposition was just juxtaposition rather than being made explicit; and the left- vs right-chiastic distinction was called chi vs ksi (however, it turns out that ksi already has an important meaning in type theory).



comments
Categories: Offsite Blogs

Stuck on design problem

haskell-cafe - Mon, 05/20/2013 - 12:25pm
All, Since I'm stuck on a coding problem and can't figure out how to proceed, I decided to call for help. I'm unable to get some code to typecheck, so maybe I'm missing something obvious on the implementation side, or more likely the design is completely wrong. Here's the idea: I have some code which uses some log of "Entry a" values (for some polymorphic type 'a'), and provides actions which output "Command a" values which should be interpreted by some wrapper code, e.g. adding some new entries to the log. These actions are implemented in a custom WriterT transformer (in this demo code, the original is more complex) to output Commands, while the inner monad should give access to the log entries (this could be in-memory like in the example, or stored on disk so using IO). You can find a trimmed-down version at https://gist.github.com/NicolasT/4230251f4f87f110d197 This doesn't type-check, and I'm not sure how to proceed. Am I taking a wrong approach? Do I need a different design? Thanks, Nicolas
Categories: Offsite Discussion

nightly builds: empty directory

glasgow-user - Mon, 05/20/2013 - 8:10am
The page http://www.haskell.org/ghc/download refers to directories for the nightly builds, that are actually empty: http://www.haskell.org/ghc/dist/current/dist/ http://www.haskell.org/ghc/dist/stable/dist/ :-(
Categories: Offsite Discussion

New Functional Programming Job Opportunities

haskell-cafe - Mon, 05/20/2013 - 7:00am
Here are some functional programming job opportunities that were posted recently: Test Engineer at Klarna http://functionaljobs.com/jobs/146-test-engineer-at-klarna Cheers, Sean Murphy FunctionalJobs.com
Categories: Offsite Discussion

Where can I find some great Haskell tutorials for those who know some functional programming concepts before?

Haskell on Reddit - Mon, 05/20/2013 - 6:48am

I have been learning ML in my functional programming course. However, in the final project my lecture asked us to contribute to an open source Haskell project he has chosen. So I need to learn Haskell very quickly. Can you recommend some Haskell tutorials suitable for me? Thanks!

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

rip in the class-abstraction continuum

haskell-cafe - Mon, 05/20/2013 - 6:16am
Hi. I won't pretend to be an advanced Haskell programmer. However, I have a strong interest in abstraction, and I have been playing around with programming as abstractly as possible. Naturally, I find classes to be quite attractive and useful. However, something is bothering me. Lately I keep running into this situation where I have to cut across abstraction layers in order to make the code work. More specifically, I keep finding that I have to add constraints to a class definition, because eventually I find some instance of that class which needs those constraints to compile. For example, I wanted to create a class which represents all things that can be converted into X,Y coordinates. Naturally, I would like to do something like this: code: -------- class XyConv a where toXy :: a b -> [Xy b] -------- This leaves me free in the future to use any number type conceivable in the Xy coordinates - Floating or Integral types, or whatever. (Doesn't even have to be numbers, actually!) However the first inst
Categories: Offsite Discussion

Anatomy of an MVar operation

Haskell on Reddit - Mon, 05/20/2013 - 5:49am
Categories: Incoming News

language-puppet: Incoming: Ruby bridge

Planet Haskell - Mon, 05/20/2013 - 3:35am

I am working on a quick and dirty Ruby bridge library, that I hope will yield a huge performance gain with template interpolation in the language-puppet library. Right now, it is capable of:

  • Initializing a Ruby interpreter from libruby
  • Calling Ruby methods and functions
  • Registering methods or functions that will be called from Ruby code
  • Converting data between the two Worlds (right now the most complex instance is the JSON one, which means that many complex Ruby types can’t be converted, but it is more than enough for passing data)
  • Embedding native Haskell values that can be passed around in Ruby to the Haskell-provided external functions (I will use this for passing the Puppet catalog state around)

There are still a few things to do before releasing it :

  • Making compilation a bit less dependant on the system. This will probably require quite a few flags in the cabal definition …
  • Hunting for memory leaks. I am not sure how to do this with the GHC Runtime in the middle, and I do hope that ruby_finalize frees everything that is managed by the Ruby runtime. After all, restarting processes seems to be the only working garbage collection method for Ruby daemons …
  • Writing stubs for the Puppet library methods that might be needed by templates. I would like to be able to support custom types and functions directly written in Ruby instead of Lua, but this will probably turn into a nightmare …
  • Cleaning things up !

Here is a quick code preview :

<figure class="code"><figcaption>test.hs </figcaption> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 {-# LANGUAGE OverloadedStrings, OverloadedStrings #-} module Main where import Foreign.Ruby.Bindings import Data.Aeson import Data.Attoparsec.Number -- this is an external function that will be executed from the Ruby interpreter -- the first parameter to the function is probably some reference to some top object -- my knowledge of ruby is close to nonexistent, so I can't say for sure ... extfunc :: RValue -> RValue -> IO RValue extfunc _ v = do -- deserialize the Ruby value into some JSON Value onv <- fromRuby v :: IO (Maybe Value) -- and display it print onv -- now let's create a JSON object containing all kind of data types let nv = object [ ("bigint" , Number (I 16518656116889898998656112323135664684684)) , ("int", Number (I 12)) , ("double", Number (D 0.123)) , ("null", "Null") , ("string", String "string") , ("true", Bool True) , ("false", Bool False) , ("array", toJSON ([1,2,3,4,5] :: [Int])) , ("object", object [ ("k", String "v") ] ) ] -- turn it into Ruby values, and return this toRuby nv -- this is the function that is called if everything was loaded properly nextThings :: IO () nextThings = do -- turn the extfunc function into something that can be called by the Ruby interpreter myfunc <- mkRegistered2 extfunc -- and bind it to the global 'hsfunction' function rb_define_global_function "hsfunction" myfunc 1 -- now call a method in the Ruby interpreter o <- safeMethodCall "MyClass" "testfunc" [] case o of Right v -> (fromRuby v :: IO (Maybe Value)) >>= print Left r -> putStrLn r main :: IO () main = do -- initialize stuff ruby_init ruby_init_loadpath -- and load "test.rb" s <- rb_load_protect "test.rb" 0 if s == 0 then nextThings else showError >>= putStrLn </figure>

And here is the ruby program, that calls our external function :

<figure class="code"><figcaption>test.rb </figcaption> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 class MyClass def self.testfunc hsfunction( [16588, "qsqsd", true, { 'a' => 'b' }, :symbol, 0.432, 5611561561186918918918618789115616591891198189123165165889 ] ).each do |k,v| puts "#{k} => #{v} [#{v.class}]" end 12 end end </figure>

And the output, showing that data is properly converted from either sides :

<figure class="code">1 2 3 4 5 6 7 8 9 10 11 Just (Array (fromList [Number 16588,String "qsqsd",Bool True,Object fromList [("a",String "b")],String "symbol",Number 0.432,Number 5611561561186918918918618789115616591891198189123165165889])) bigint => 16518656116889898998656112323135664684684 [Bignum] int => 12 [Fixnum] double => 0.123 [Float] array => 12345 [Array] true => true [TrueClass] null => Null [String] string => string [String] object => kv [Hash] false => false [FalseClass] Just (Number 12)</figure>

EDIT: added link to the code.

Categories: Offsite Blogs

ANN: lambdabot-4.3

haskell-cafe - Sun, 05/19/2013 - 11:41pm
As discussed a couple months ago, I have assumed maintainership of Lambdabot and a a new release has been brewing for a while. It has now been Hackaged as lambdabot-4.3. There are quite a few changes in this release, mainly internal. Plugins written for older versions will require some fairly straightforward rewriting - the plugin interface is now based on a record rather than a type class, and makes use of some simple monad transformers to stabilize the API a bit in the face of future changes. There are many things I'd like to do to continue modernizing it, the most significant of which being that I'd like to overhaul the state storage system and break it down into smaller packages. Therefore, plugin-writers should consider this a bit of a stepping-stone release - in the not too distant future, another release will probably break the plugin API again. If you have open-source plugins, please let me know and I'll feed you patches to keep up with any changes coming down the pipeline. The most signific
Categories: Offsite Discussion

www.glc.us.es

del.icio.us/haskell - Sun, 05/19/2013 - 11:28pm
Categories: Offsite Blogs

www.glc.us.es

del.icio.us/haskell - Sun, 05/19/2013 - 11:28pm
Categories: Offsite Blogs

www.glc.us.es

del.icio.us/haskell - Sun, 05/19/2013 - 11:28pm
Categories: Offsite Blogs