News aggregator

New Student to Haskell

Haskell on Reddit - Tue, 01/20/2015 - 3:25pm

Hey guys,

First off, I've never posted on here before, so I hope I'm doing this correctly.

Anyways I was wondering how I, as a new student, can expand my knowledge/familiarity with what haskell can be used for in the real world. My haskell class that I'm taking is kinda slow for me and my experience with coding, so I want to get a head start with some personal projects. Unfortunately, I'm not sure where to find exercises/projects that I can solve with haskell on my own, and I was hoping someone could point me in the right direction.

Basically, I'm asking what small project can I create using Haskell? A video game? A database? Something on a website?

I don't know much about Haskell, or functional programming, since I am mostly familiar with object oriented Java and Python, so again, not sure what to pursue to fully understand this aspect of the programming language.

I know I can read books and articles and such but for me and many other programmers I know, the best way to learn is to program in the language itself.

So again, I'm looking for what I can pursue as a small project to help me get ahead with familiarity with the language.

Any references or examples to get started would be much appreciated.

Thanks! -President

submitted by Clown_For_President
[link] [20 comments]
Categories: Incoming News

Philip Wadler: Democracy vs the 1%

Planet Haskell - Tue, 01/20/2015 - 2:37pm

To celebrate the 750th anniversary of the first meeting of the British parliament, the BBC Today programme sponsored a special edition of The Public Philosopher, asking the question Why Democracy? The programme spent much time wondering why folk felt disenfranchised but spent barely two minutes on the question of how wealth distorts politics. (Three cheers to Shirley Williams for raising the issue.) An odd contrast, if you compare it to yesterday's story that the wealthiest 1% now own as much as the other 99% combined; or to Lawrence Lessig's Mayday campaign to stop politicians slanting their votes to what will help fund their reelection; or to Thomas Picketty's analysis of why the wealthy inevitably get wealthier. (tl;dr: "Piketty's thesis has been shorthanded as r > g: that the rate of return on capital today -- and through most of history -- has been higher than general economic growth. This means that simply having money is the best way to get more money.")
Categories: Offsite Blogs


haskell-cafe - Tue, 01/20/2015 - 2:33pm
Hi! I'm working with a lot of HashMap's and it's very frustrating how many times I've "lost" my data because of usage of either a Monoid instance of a HashMap (which is defined as H.union, which, upon collision, takes value from first hm and discards from second), or just using fromList in the wrong place. Whereas the data I'm working is is mostly defined as (Monoid v => HashMap k v), so what I need "by default" is actually something like `H.unionWith (<>)`. What I was wondering is this: is something like MonoidHashMap is desired to be in unordered-containers, or is this use-case only popular in my programs? I'm asking because I have a feeling that this thing might be useful quite a lot for others also. If not -- sorry for bothering :) Cheers! _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

Perform simple IO in Haskeline, inside InputT monad, without having to resort to unsafePerformIO

Haskell on Reddit - Tue, 01/20/2015 - 1:23pm

Given the proof of concept code below I'd like to be able to somehow perform my foo function with the ability to output the string Paul! and the possibility of getting its return value inside the InputT monad-transformer without using unsafePerformIO to remove the IO wrapper after runExceptT.

import Control.Monad.Except import System.IO.Unsafe (unsafePerformIO) import System.Console.Haskeline type ErrorWithIO = ExceptT String IO foo :: String -> ErrorWithIO String foo "paul" = do liftIO $ putStrLn "Paul!" return "OK!" foo _ = throwError "ERROR!" runRepl :: IO () runRepl = runInputT defaultSettings $ loop loop :: InputT IO () loop = do line <- getInputLine "> " case line of Nothing -> return () Just input -> do return $ putStrLn "asd" case unsafePerformIO $ runExceptT $ foo input of Left err -> outputStrLn err >> loop Right res -> do x <- outputStrLn . show $ res loop main :: IO () main = runRepl >> putStrLn "Goodbye!"

Am I missing something obvious here?

submitted by paullik
[link] [12 comments]
Categories: Incoming News

GHC 7.10 regression when using foldr

glasgow-user - Tue, 01/20/2015 - 1:20pm
I just discovered that the following program compiled fine using GHC 7.8.4 but was rejected by GHC 7.10.1-rc1: ~~~ data List a = Nil | Cons a (List a) instance Read a => Read (List a) where readsPrec d s = map convert (readsPrec d s) where convert (xs, s2) = (foldr Cons Nil xs, s2) ~~~ GHC 7.10 now complains: ~~~ Read.hs:5:23: Could not deduce (Foldable t0) arising from a use of ‘convert’ from the context (Read a) bound by the instance declaration at Read.hs:4:10-32 The type variable ‘t0’ is ambiguous Note: there are several potential instances: instance Foldable (Either a) -- Defined in ‘Data.Foldable’ instance Foldable Data.Proxy.Proxy -- Defined in ‘Data.Foldable’ instance GHC.Arr.Ix i => Foldable (GHC.Arr.Array i) -- Defined in ‘Data.Foldable’ three others In the first argument of ‘map’, namely ‘convert’ In the expression: map convert (readsPrec d s) In an equation for ‘readsPrec’:
Categories: Offsite Discussion

pdf - Tue, 01/20/2015 - 12:52pm
Categories: Offsite Blogs

Haskell - Tue, 01/20/2015 - 12:51pm
Categories: Offsite Blogs

CFP: CRV15 - 2nd Competition on Runtime Verification

General haskell list - Tue, 01/20/2015 - 9:29am
CRV 2015 The 2nd International Competition on Runtime Verification, held with RV 2015, September 22 – 25, 2015 Vienna, Austria CRV-2015 is the 2nd International Competition on Runtime Verification and is part of the 15th International Conference on Runtime Verification. The event will be held in September 2015, in Vienna, Austria. CRV-2015 will draw attention to the invaluable effort of software developers and researchers who contribute in this field by providing the community with new or updated tools, libraries and frameworks for the instrumentation and runtime verification of software. Runtime Verification is a verification technique for the analysis of software at execution-time based on extracting information from a running system and checking if the observed behaviors satisfy or violate the properties of interest. During the last decade, many important tools and techniques have been developed and successfully employed. However, there is a pressing need to compare such tools and techniques, since
Categories: Incoming News

ghc-7.10.0 type inference regression when faking injective type families

glasgow-user - Tue, 01/20/2015 - 7:29am
Hello List, With ghc - 7.8 and 7.6 the following program is accepted: {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} class (UnF (F a) ~ a, Show a) => C a where type F a f :: F a -> a type family UnF a g :: forall a. C a => a -> String g _ = show a where a = f (undefined :: F a) -- :: a ghc- does not accept the program unless I uncomment the type signature (a :: a). I believe this is the main difference that prevents HList from compiling with 7.10, but I could have made a mistake in coming up with this minimal example. Regards, Adam
Categories: Offsite Discussion

Help with identity functor print instance and monadtransformers

haskell-cafe - Tue, 01/20/2015 - 7:09am
I understand the error below, but I'm not really sure what an instance of liftIO would look like for the Identity functor. I guess I'm not all to clear on what an identity functor is. I'm a little fuzzy on what an identity monad is. I understand that id gives the identity of something back pretty well though. Can anyone help? If anyone could help me fix the code below as well as explain the questions I have above it would be a great help. import Control.Monad.Trans.State import Control.Monad.IO.Class type MyState = State Int modAndPrintState :: Int -> MyState () modAndPrintState x = do get >>= \i -> do liftIO . print $ i if even x then put (x + i) else put (i * (x + 1) - x) main = undefined
Categories: Offsite Discussion

Package version question with Cabal

glasgow-user - Tue, 01/20/2015 - 6:14am
Hi! I've uploaded my library to Hackage, and now I'm trying to install it via cabal: ~/src/hsshellscript $ cabal install Resolving dependencies... In order, the following will be installed: hsshellscript-3.3.3 (reinstall) Warning: Note that reinstalls are always dangerous. Continuing anyway... Configuring hsshellscript-3.3.3... Building hsshellscript-3.3.3... Preprocessing library hsshellscript-3.3.3... In-place registering hsshellscript-3.3.3... Creating package registration file: /tmp/pkgConf-hsshellscript-3.37397.3 Installing library in /home/v/.cabal/lib/x86_64-linux-ghc-7.8.3/hsshellscript-3.3.3 Registering hsshellscript-3.3.3... Installed hsshellscript-3.3.3 ~/src/hsshellscript $ cabal list hsshellscript * hsshellscript Synopsis: Haskell for Unix shell scripting tasks Default available version: 3.3.2 Installed versions: 3.3.1, 3.3.2, 3.3.3 Homepage: License: LGPL The thing wich looks like a problem is, that the new version isn't made t
Categories: Offsite Discussion

ghc 7.8.4 fedora

Haskell on Reddit - Tue, 01/20/2015 - 1:16am

[Solved]I got it now sudo yum remove ghc* sudo yum autoremove sudo yum-config-manager --add-repo sudo yum install ghc-7.8.4

submitted by hornysama
[link] [22 comments]
Categories: Incoming News

wren gayle romano: Back in action

Planet Haskell - Mon, 01/19/2015 - 11:39pm

I don't think I ever mentioned it here but, last semester I took a much-needed sabbatical. The main thing was to take a break from all the pressures of work and grad school and get back into a healthy headspace. Along the way I ended up pretty much dropping off the internet entirely. So if you've been missing me from various mailing lists and online communities, that's why. I'm back now. If you've tried getting in touch by email, irc, etc, and don't hear from me in the next few weeks, feel free ping me again.

This semester I'm teaching foundations of programming language theory with Jeremy Siek, and work on the dissertation continues apace. Over the break I had a few breakthrough moments thinking about the type system for chiastic lambda-calculi— which should help to clean up the normal forms for terms, as well as making room for extending the theory to include eta-conversion. Once the dust settles a bit I'll write some posts about it, as well as continuing the unification-fd tutorial I started last month.

Categories: Offsite Blogs