News aggregator

What is the current state of ghci or any editor documentation tools?

Haskell on Reddit - Fri, 01/08/2016 - 7:17pm

Problem: I think everyone guessed from the title, but maybe my language is bad and ambiguous. Well, for example you use :browse Data.List and found dropWhile which sounds like what you need, but there is also dropWhileEnd with same type. To see difference you open hoogle, search by name, search in list, read the docs. There should be something faster, like command line tool and something smart enough to get documentation for current entity. Example: python's "help" function. My search of solution was difficult, because there is a lot of noise: people recommend to use type information and hoogle instead of documentation, but it is addition to documentation - not replacement.

Possible solutions:

  • As far as I discovered - there is the ticket for haddock documentation in ghci https://ghc.haskell.org/trac/ghc/ticket/2168 - it is sounds nice but it is 8 years old. 10 month ago was posted two nice comments and priority changed to normal, but it means nothing. Is there any published plans about .hi metadata?
  • hoogle. Well, it is nice cli search tool, can I somehow specify package, open item in browser?
  • dash, zeal. I am found two tools ( https://github.com/jfeltz/dash-haskell/ and https://github.com/philopon/haddocset ) for generating docsets from cabal (second tool using stack) packages. Zeal have command line util, so may be used from ghci. Also zeal may specify package. I'm not tried yet, but it is very close to that I want and still can't be used with loaded entities - only manual typing.
  • Haddock have api!. Which used in two tools above. And also in leksah (someone using lesah? any documentation support for entity under cursor?).

What I want to know:

  • anyone has a better solution? (any solution)
  • anyone want a better solution?
  • is it possible to solve the problem? I am planning to spend some time for it. But as far as I can see there is no any interest or it is very hard (more then 8 years) task.

Probably developer of solution need to get current modules loaded in ghci and pass to haddock api and get entity by name.

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

A good Haskell graph library which can check for embeddability?

Haskell on Reddit - Fri, 01/08/2016 - 6:59pm

I need a graph library in Haskell which, given node-labelled graphs G and H, can check if G can be embedded into H. We can assume that the graphs have the same set of node labels. Can anyone make any suggestion, or am I rolling an extension?

submitted by KozRoss
[link] [1 comment]
Categories: Incoming News

Your favourite language extension?

Haskell on Reddit - Fri, 01/08/2016 - 6:29pm

What's you favourite GHC language extension and what do you like about it (e.g. removing boiler plate code, extending the type system etc.)?

submitted by MyFunc
[link] [36 comments]
Categories: Incoming News

how to make it work so that I can do two things after a maybe ->

Haskell on Reddit - Fri, 01/08/2016 - 4:11pm

I have this code :

doDepositAccount :: [Account] -> IO [Account] doDepositAccount accounts = do putStrLn "On which account to do want to deposit?" accountNameToDeposit <- getLine let newAccounts = depositAccount accountNameToDeposit accounts return newAccounts depositAccount :: String -> [Account] -> [Account] depositAccount s accts = acctsAfter where maybeIndex = findIndex (isAccount s) accts acctsAfter = case maybeIndex of Nothing -> accts Just idx -> accts

Now I want to ask a user to enter another thing and update a value nl the right part of the accounts array.

Is this possibe and how do I achieve this ?

submitted by wobbenr
[link] [2 comments]
Categories: Incoming News

Unifying distinct type variables in TypeApplications

Haskell on Reddit - Fri, 01/08/2016 - 2:52pm

Given these types from constraints:

data Dict a where Dict :: a => Dict a newtype a ⊢ b = Sub (a => Dict b) >>> :set -fprint-explicit-kinds >>> :set -fprint-explicit-foralls >>> :t Sub Sub :: forall (a :: Constraint) (b :: Constraint). (a => Dict b) -> a ⊢ b

I want to be able to use TypeApplications (new feature in GHC 8) to witness that Ord a implies Eq a for all a. Writing Sub @(Ord a) fails because a is not in scope so I use partial type signatures:

>>> :t Sub @(Ord _) Sub @(Ord _) :: forall {t} (b :: Constraint). (Ord t => Dict b) -> Ord t ⊢ b >>> :t Sub @(Ord _) @(Eq _) Sub @(Ord _) @(Eq _) :: forall {t} {t1}. (Ord t => Dict (Eq t1)) -> Ord t ⊢ Eq t1 >>> :t Sub @(Ord _) @(Eq _) Dict Sub @(Ord _) @(Eq _) Dict :: forall {t} {t1}. Eq t1 => Ord t ⊢ Eq t1

but now t and t1 are distinct type variables, same with Sub @(Ord _a) @(Ord _a) Dict.

One way is to add a type annotation and a quantifier:

>>> :t Sub @(Ord a) @(Eq a) Dict :: forall a. _ Sub @(Ord a) @(Eq a) Dict :: forall a. _ :: forall a. Ord a ⊢ Eq a

Is there any trick to getting them to unify without a type annotation or signature?

Edit: Created ticket #11385.

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

What is the motivation for extensible effects?

Haskell on Reddit - Fri, 01/08/2016 - 1:48pm

I'm struggling to understand the overarching motivation for extensible effects, i.e. for tracking arbitrary categories of effects in the type system and how to compose them. It seems similar to the pursuit of checked exceptions, which appears good in theory but is practically more trouble than it's worth. I'm not trying to pass a value judgment; I'm only confused as to why so many people find this approach valuable. Can someone enlighten me?

submitted by eacameron
[link] [39 comments]
Categories: Incoming News

Haskell Weekly News

General haskell list - Fri, 01/08/2016 - 1:34pm
Folks: Recall the quote from the May Day 2015 issue: <http://haskell.1045720.n5.nabble.com/Haskell-Weekly-News-td5808226.html> The MLs and Haskell remind me of Brian Eno's line about how the first Velvet Underground album only sold 30,000 copies, but "everyone who bought one of those 30,000 copies started a band". This issue spotlights Elm and Idris, two languages implemented in Haskell. Enjoy! *Top Picks:* - Evan Czaplicki of the Elm web-front-end language leaves Prezi for NoRedInk <http://elm-lang.org/blog/new-adventures-for-elm>. A startup dedicated to improving high-school English grammar, NoRedInk already employs 5 engineers writing Elm full-time. A HN comment hyperbolizes that Elm <https://news.ycombinator.com/item?id=10837278#up_10838052> "is Clojure without parens, it's Haskell without academy, it's Redux without facebook, it's duck-typing without quacks, it's MVC without objects, and last but not least Evan Czaplicki (the creator) is the new Aaron Patterson (bright a
Categories: Incoming News

Data declaration vs type classes

haskell-cafe - Fri, 01/08/2016 - 11:55am
Dear haskellers, What is the difference between writing data Task = GroceryTask String | LaundryTask Int doTask :: Task -> IO () doTask (GroceryTask s) = print "Going to " ++ s doTask (LaundryTask n) = print (show n ++ " pieces washed" and class Task a where work :: a -> IO () data GroceryTask = GroceryTask String data LaundryTask = LaundryTask Int instance Task GroceryTask where .. instance Task LaundryTask where .. doTask :: Task a => a -> IO () doTask = work They seem to be similar functionality wise, except that one is on the data level and another is on the class level. How should one go about deciding to use data or class? Is there a semantic difference? Which is more appropriate here? Happy new year, Hon _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

LambdaConf 2016: Call for Proposals (May 26 - 29)

haskell-cafe - Fri, 01/08/2016 - 12:00am
Hi all, We have officially opened the call for proposals for LambdaConf 2016 <http://lambdaconf.us/>LambdaConf 2016 <http://lambdaconf.us/>! LambdaConf is the one of the largest and most respected conferences on functional programming in the world. With more than a hundred hours of high-quality content from leading practitioners and researchers, LambdaConf is designed to take attendees' skills to the next level, whether they are just beginning or are highly experienced in the art of functional programming. Last year, Haskell content truly dominated the conference, with many workshops and well more than a full track of Haskell presentations. This year, we'd like to repeat that, as well as see strong submissions from related languages such as PureScript (PureScript Conf 2016 is co-located with and will immediately precede LambdaConf). We are looking for speakers who want to share their knowledge of the Haskell language (past, present, and future), Haskell libraries, Haskell tools, real-world Haskell use c
Categories: Offsite Discussion

7.10.3 source link missing

haskell-cafe - Thu, 01/07/2016 - 8:31pm
Hi all, Just wanted to make haskell.org maintainers aware that 7.10.3 release does not provide a link to the source distribution on the Download page. https://www.haskell.org/ghc/download_ghc_7_10_3#sources. Thanks! -deech _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

wrong GHC source files

haskell-cafe - Thu, 01/07/2016 - 6:03pm
https://www.haskell.org/ghc/download_ghc_7_10_3#sources reads Source Distribution ----------------------------------------------------------------------------- The source tarballs provide everything necessary to build the compiler, interactive system, and a minimal set of libraries. For more information on building, see the building guide. ghc-7.10.3b-windows-extra-src.tar.bz2 (92 MB) ghc-7.10.3b-windows-extra-src.tar.xz (91 MB) Shouldn't the two files be as follows? ghc-7.10.3b-src.tar.bz2 ghc-7.10.3b-src.tar.xz _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

New gtk2hs 0.12.4 release

gtk2hs - Wed, 11/21/2012 - 12:56pm

Thanks to John Lato and Duncan Coutts for the latest bugfix release! The latest packages should be buildable on GHC 7.6, and the cairo package should behave a bit nicer in ghci on Windows. Thanks to all!

~d

Categories: Incoming News