Re: [Haskell-cafe] If you'd design a Haskell-like language, what would you do different?

2011-12-19 Thread Roman Cheplyaka
* Alexander Solla  [2011-12-19 19:10:32-0800]
> * Documentation that discourages thinking about bottom as a 'value'.  It's
> not a value, and that is what defines it.

In denotational semantics, every well-formed term in the language must
have a value. So, what is a value of "fix id"?

-- 
Roman I. Cheplyaka :: http://ro-che.info/

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] CfP: Extended Submission Deadline TAP 2012 (International Conference on Test and Proofs)

2011-12-19 Thread Achim D. Brucker
(Apologies for duplicates) 


*** TAP 2012 offers extended submission deadlines due to ***
*** numerous requests received:  ***
*** Abstract submission: January 11, 2012***
*** Paper submission:January 18, 2012***

*** TAP 2012 solicits both full papers and (industrial)  ***
***   experience/tool papers *** 
***  in combining proofs and (security) testing. *** 

   

CALL FOR PAPERS
Full and short Research Paper, Industrial Experience Papers, Tool Papers 
Abstract submission: Jan 11, 2012, Paper submission Jan 18, 2012 

  6th INTERNATIONAL CONFERENCE ON TEST AND PROOFS (TAP 2012)
  http://lifc.univ-fcomte.fr/tap2012/
  May 31 - June 1, 2012, Prague, Czech Republic

   Part of the TOOLS Federated Conferences 2012
http://tools2012.fit.cvut.cz/

The TAP conference is devoted to the convergence of proofs and tests,
to the application of techniques from both sides and their combination
for the advancement of software quality. Test and Proof seem to be
contradictory techniques: if you have proved your program to be
correct, it is fruitless to comb it for bugs; and if you are testing
it, that is surely a sign that you have given up on any hope to prove
its correctness.  Accordingly, proofs and tests have, since the onset
of software engineering research, been pursued by distinct
communities.

However, the development of both approaches lead to the discovery of
common issues and to the realization that each may need the other. The
emergence of model checking has been one of the first signs that
contradiction may yield to complementarity. Further evidence give test
data generation techniques from models or programs which boil down to
constraint resolution techniques for relatively large formula; the
advent of powerful SMT solvers have therefore powered new testing
techniques.  Finally, since formal, proof-based verification is
costly, testing invariants and background theories can be helpful to
detect errors early and to improve cost effectivity.  Summing up, in
the past few years an increasing number of research efforts have
encountered the need for combining proofs and tests, dropping earlier
dogmatic views of incompatibility and taking instead the best of what
each of these software engineering domains has to offer.

The TAP conference aims to bring together researchers and practitioners
working in the converging fields of testing and proving, and will offer
a generous allocation of papers, panels and informal discussions.

Topics of interest cover theory definitions, tool constructions and 
experimentations and include (other topics related to TAP are welcome):
- Transfer of concepts from testing to proving (e.g., coverage criteria)
  and from proving to testing
- Program proving with the aid of testing techniques
- New problematics in automated reasoning emerging from specificities
  of test generation
- Verification and testing techniques combining proofs and tests
- Generation of test data, oracles, or preambles by deductive
  techniques such as: theorem proving, model checking, symbolic
  execution, constraint logic programming
- Model-based testing and verification
- Generation of specifications by deduction
- Automatic bug finding
- Debugging of programs combining static and dynamic analysis
- Formal frameworks
- Tool descriptions and experience reports
- Case studies combining tests and proofs
- Applying combination of test and proof techniques to new application 
  domains such as validating security procotols or vulnerability
  detection of programs 

Important Dates:

Abstract submission (extended):January 11, 2012 
Paper submission (extended):   January 18, 2012
Notification:  March 2, 2012
Camera ready version:  March 19, 2012
TAP conference:May 31 - June 1, 2012 

TOOLS conferences (TOOLS, ICMT, SC, TAP): May 29 - June 01, 2012
Conference Chairs: Bertrand Meyer
Program Chairs:Achim D. Brucker and Jacques Julliand

Program Committee (to be extended): 
===
Nazareno Aguirre, Bernhard K. Aichernig, Paul Ammann, Dirk Beyer,
Nikolaj Bjorner, Robert Clarisó, Marco Comini, Catherine Dubois,
Gordon Fraser, Angelo Gargantini, Alain Giorgetti, Patrice Godefroid, 
Martin Gogolla, Arnaud Gotlieb, Reiner Hähnle, Bart Jacobs, Thierry Jéron, 
Gregory Kapfhammer, Nikolai Kosmatov, Victor Kuliamin, Karl Meinke, Jeff 
Offutt, Holger Schlingloff, T.H. Tse, Margus Veanes, Luca Viganò, Burkhart 
Wolff, Fatiha Zaidi

Submission:
===
Please submit your papers via http://lifc.univ-fcomte.fr/tap2012/. 
TAP 20

Re: [Haskell-cafe] [Alternative] change some/many semantics

2011-12-19 Thread David Menendez
On Mon, Dec 19, 2011 at 6:37 PM, wren ng thornton  wrote:
> On 12/14/11 10:58 PM, Gregory Crosswhite wrote:
>>
>> Of course, this is not a simple change at all because it would have to
>> be done in such a way as to respect the ordering of actions --- that
>> is, we can't have each action executed only when the corresponding
>> element of the list demanded is forced, or else actions would
>> undesirably interleave.
>
>
> Therein lies the issue. To put this in a monadic context, this is the same
> reason why we can't just say:
>
>    evalState (repeatM getNext) init
>
> e.g., to generate an infinite list of pseudorandom numbers and then discard
> the final seed because we have all the numbers we'll ever need.

Sure you can. Just make sure you're using a non-strict state monad.

import Control.Monad.Identity
import Control.Monad.State.Lazy
import System.Random

repeatM :: Monad m => m a -> m [a]
repeatM = sequence . repeat

nextM :: RandomGen g => StateT g Identity Int
nextM = StateT $ Identity . next

*Main> g <- getStdGen
*Main> let ints = runIdentity $ evalStateT (repeatM nextM) g
*Main> :t ints
ints :: [Int]
*Main> take 5 ints
[1259974427,117524251,96384700,1814821362,997859942]
*Main> take 10 ints
[1259974427,117524251,96384700,1814821362,997859942,2058526379,835643552,1075525457,727974455,388071455]
*Main> ints !! 100
271901956


-- 
Dave Menendez 


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] If you'd design a Haskell-like language, what would you do different?

2011-12-19 Thread Alexander Solla
On Mon, Dec 19, 2011 at 11:20 AM, Robert Clausecker wrote:

> Image you would create your own language with a paradigm similar to
> Haskell or have to chance to change Haskell without the need to keep any
> compatibility. What stuff would you add to your language, what stuff
> would you remove and what problems would you solve completely different?
>
> Thanks in advance for all answers, yours
>

* Lenses as the default record infrastructure.  (Maybe...)
* Better organization of numeric (and algebraic/categorical) type classes
in the Prelude.
* Documentation that discourages thinking about bottom as a 'value'.  It's
not a value, and that is what defines it.
* Getting rid of the Functor/Monad nonsense.  (Every monad is in fact a
functor, but we can't use fmap on arbitrary monads in Haskell)
* The inclusion of something like Djinn to automatically generate free
theorems from types.  It would be nice if GHCi included an interactive
Djinn-like interface to generate alternative non-free functions for a type.
* An API to make automating REPL and text editor interactions
straight-forward.  (For example, if we were to use the hypothetical
Djinn-like feature, we could select the implementation we want from a list
and have it pasted into our text editor of choice automatically)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Alternative] change some/many semantics

2011-12-19 Thread wren ng thornton

On 12/15/11 8:26 AM, Gregory Crosswhite wrote:

Put another way, the problem with Maybe computations is that if there
is a failure at any point in the computation than *the entire
computation fails*, and this means that you can't lazily generate a
list of results using some/many because you can't tell whether your
computation was a success or a failure until the entire infinite
computation has been run;


exactamente.

--
Live well,
~wren

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Alternative] change some/many semantics

2011-12-19 Thread wren ng thornton

On 12/14/11 10:58 PM, Gregory Crosswhite wrote:

Of course, this is not a simple change at all because it would have to
be done in such a way as to respect the ordering of actions --- that
is, we can't have each action executed only when the corresponding
element of the list demanded is forced, or else actions would
undesirably interleave.


Therein lies the issue. To put this in a monadic context, this is the 
same reason why we can't just say:


evalState (repeatM getNext) init

e.g., to generate an infinite list of pseudorandom numbers and then 
discard the final seed because we have all the numbers we'll ever need. 
Hidden lurking in this expression is the fact that the state being 
passed around eventually becomes bottom. We don't especially care, since 
evalState is discarding the state, but the fact remains that we have to 
compute it. Indeed, we can't even define 'repeatM' sensibly, for the 
same reason.


We can only compute a list of responses lazily if we happen to be in a 
monad/applicative where we can guarantee that pulling all the effects up 
to the top is equivalent to performing them lazily/interleaved. However, 
even in the cases where that can be guaranteed, we don't have any 
especially good mechanism for informing GHC about that fact.


The reason why 'some' and 'many' can escape this ---in the case of 
parsers at least--- is that they will run for a (deterministic) fixed 
length of time and then return. If you're parsing any finite-length 
text, then there's an upper bound on how many times the action can run 
before it fails. This is the same reason why we can define 'replicateM' 
even though we can't define 'repeatM'. The only difference is that with 
'replicateM' the termination criterion is extrinsic to the monad (it's 
induction on Int), whereas with 'some' and 'many' the termination 
criterion is intrinsic to whatever the side-effects of the action are. 
The problem is that for Maybe and lists, there is no intrinsic state 
which would allow an action to succeed sometimes and fail other times 
(thereby providing an intrinsic means for termination).


--
Live well,
~wren

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Splitting off many/some from Alternative

2011-12-19 Thread wren ng thornton

On 12/14/11 9:52 PM, Brandon Allbery wrote:

That's kinda where I am right now; I'm being told simultaneously that (a)
it makes sense to have Applicative and Alternative for Maybe, and (b) it
doesn't make sense to have many and some for Maybe, and (c) if you have
Applicative and Alternative then many and some automatically follow.
These statements are not mutually logically consistent, and leave me
wondering if Applicative and/or Alternative have been fully thought out.


I think we can all safely agree that the Applicative instance for Maybe 
is both sound and sensible. Afterall, it captures exactly the same idea 
as the monad instance: (explicitly) partial functions.


The only difference is that the Applicative instance removes (in theory) 
the ordering constraints imposed by Monad, and therefore allows a more 
functional/applicative style of programming in lieu of the imperative 
style a la do-notation. The loss of ordering restrictions is only in 
theory because in order to propagate failures correctly we must use 
call-by-value semantics--- or, rather, we must be explicit about when 
we're not evaluating something (and so may safely discard its potential 
for returning Nothing). So, we can get rid of all the ordering 
differences between different call-by-value systems, but we're not 
completely confluent.


--
Live well,
~wren

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Sharing on equality

2011-12-19 Thread wren ng thornton

On 12/13/11 10:52 AM, Johan Brinch wrote:

Hey all,

Can GHC eliminate one of two equal ByteStrings, when they are compared
and turns out to be equal?


Say i have a map, ByteString ->  Int.

I now do a lookup on a ByteString and if it exists, I insert this
ByteString into a list.

Is it possible to avoid using more memory, than used by the keys in
the map + the list structure?

I.e. is it possible to eliminate the redundant ByteStrings somehow?


Somehow? yes. Probably the easiest route is just to use:

-- Or better yet, use one of the HashMap structures
type MyMap a = Map ByteString (ByteString,a)

myInsert :: ByteString -> a -> MyMap a -> MyMap a
myInsert k v = insert k (k,v)

myLookup :: ByteString -> MyMap a -> Maybe a
myLookup k = fmap snd . lookup k

...

If you really care a lot about memory overhead and sharing, there are 
two other approaches which are more work but have nice payoffs.


The first option is to use a trie structure which automatically prunes 
the key segments and allows you to reconstruct the keys. The 
bytestring-trie package does this. This approach has its own set of 
costs and benefits compared to plain mapping structures, so whether you 
want to go down this road will depend on what functionality you need. If 
you don't actually need the trie functionality (e.g., the ability to get 
the subtrie of all keys with a given prefix, or the ability to look up 
the values for all prefixes of a given key), then you're probably better 
off using a hashtable-based solution, like the hashmap or 
unordered-containers packages.


The second option is to use interning in order to ensure uniqueness of 
your expensive structures. That is, you implement the interface:


type InternId
-- e.g., newtype InternId = IId Int

instance Eq InternId
-- this should be faster than (Eq a)

-- you should also have instances for use in unboxed arrays, etc

type InternTable a
-- e.g., newtype InternTable a = IT (IntMap a, Map a InternId)

intern :: a -> InternTable a -> (InternTable a, InternId)

unintern :: InternId -> InternTable a -> a

...

And then you pass around the InternIds instead of the actual strings. 
This ensures low memory overhead for passing around and duplicating 
things, ensures fast equality comparisons, and ensures uniqueness 
whenever you need to deal with the actual structure instead of an 
identifier for it. Of course, you can generalize this idea to any data 
structure, not just strings; just google for "hash consing".


I have a decently tuned implementation of ByteString interning laying 
around, which I'm hoping to put on Hackage before classes start up again 
in January. Of course, for extremely fine tuning we'd want to adjust the 
size of the InternId representation based on a heuristic upper-bound on 
the number of items we'll have, so that we can pack the unboxed arrays 
more tightly or do tricks like packing four 8-bit ids into a Word32. Of 
course, presenting a nice API for that would require using associated 
types which is GHC-only (the fundep version wouldn't be quite so 
pretty). I'll probably do that in the future once I locate some round tuits.


--
Live well,
~wren

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How hard is it to start a web startup using Haskell?

2011-12-19 Thread Yves Parès
> Haskell is a mature platform that provides lots of goodies that I might
otherwise have to write (like the goodies I wrote in Lift including an
Actors library)

I don't get it: Actors are at the core of Scala concurrency model, and are
expanded for distributed programming through Akka for instance.
To me it'd be the other way around: you'd have to develop Actors in
Haskell, don't you?
Or maybe you don't mean the same thing by 'Actor'?

2011/12/19 David Pollak 

> On Mon, Dec 19, 2011 at 2:04 AM, Ivan Perez 
> wrote:
>
>> I'm actually trying to make a list of companies and people using Haskell
>> for for-profit real world software development.
>>
>> I'd like to know the names of those startups, if possible.
>>
>
> I am building http://visi.pro on Haskell.  I am doing it for a number of
> reasons:
>
>- Haskell is a mature platform that provides lots of goodies that I
>might otherwise have to write (like the goodies I wrote in Lift including
>an Actors library)
>- Haskell allows a lot of nice "things" that make building a language
>and associated tools easier (like laziness)
>- Haskell is a filter for team members. Just like Foursquare uses
>Scala as a filter for candidates in recruiting, I'm using Haskell as a
>filter... if you have some good Haskell open source code, it's a way to
>indicate to me that you're a strong developer.
>
>
>
>>
>> -- Ivan
>>
>> On 18 December 2011 18:42, Michael Snoyman  wrote:
>> > On Sun, Dec 18, 2011 at 6:57 PM, Gracjan Polak 
>> wrote:
>> >>
>> >> Hi all,
>> >>
>> >> The question 'How hard is it to start a technical startup with
>> Haskell?'
>> >> happened a couple of times on this list. Sometimes it was in the form
>> 'How hard
>> >> is to find Haskell programmers?' or 'Are there any Haskell jobs?'.
>> >>
>> >> I'd like to provide one data point as an answer:
>> >>
>> >>
>> http://www.reddit.com/r/haskell/comments/ngbbp/haskell_only_esigning_startup_closes_second_angel/
>> >>
>> >> Full disclosure: I'm one of two that founded this startup.
>> >>
>> >> How are others doing businesses using Haskell doing these days?
>> >
>> > I don't run a startup myself, but I know of at least three startups
>> > using Haskell for web development (through Yesod), and my company is
>> > basing its new web products on Yesod as well. I think there are plenty
>> > of highly qualified Haskell programmers out there, especially if
>> > you're willing to let someone work remotely.
>> >
>> > Michael
>> >
>> > ___
>> > Haskell-Cafe mailing list
>> > Haskell-Cafe@haskell.org
>> > http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>> ___
>> Haskell-Cafe mailing list
>> Haskell-Cafe@haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>
>
>
> --
> Visi.Pro, Cloud Computing for the Rest of Us http://visi.pro
> Lift, the simply functional web framework http://liftweb.net
> Follow me: http://twitter.com/dpp
> Blog: http://goodstuff.im
>
>
>
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] How to get Cabal to spit out a .a library suitable for linking into C/Objective-C

2011-12-19 Thread David Pollak
Howdy,

I'm trying to figure out how to get Cabal configured to compile and link my
Haskell code such that the code can be part of C and/or Objective-C code
such that all the Haskell dependencies are rolled into a .a file and can be
linked by a normal C linker (e.g., ld).

I've been through
http://haskell.org/ghc/docs/6.12.2/html/users_guide/ffi-ghc.html#using-own-mainand
the associated linked, but I'm unable to find out the Cabal
incantation
to output a library that's linkable into my other code.  Any pointers or
examples would be greatly appreciated.

Thanks,

David

-- 
Visi.Pro, Cloud Computing for the Rest of Us http://visi.pro
Lift, the simply functional web framework http://liftweb.net
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How hard is it to start a web startup using Haskell?

2011-12-19 Thread David Pollak
On Mon, Dec 19, 2011 at 2:04 AM, Ivan Perez wrote:

> I'm actually trying to make a list of companies and people using Haskell
> for for-profit real world software development.
>
> I'd like to know the names of those startups, if possible.
>

I am building http://visi.pro on Haskell.  I am doing it for a number of
reasons:

   - Haskell is a mature platform that provides lots of goodies that I
   might otherwise have to write (like the goodies I wrote in Lift including
   an Actors library)
   - Haskell allows a lot of nice "things" that make building a language
   and associated tools easier (like laziness)
   - Haskell is a filter for team members. Just like Foursquare uses Scala
   as a filter for candidates in recruiting, I'm using Haskell as a filter...
   if you have some good Haskell open source code, it's a way to indicate to
   me that you're a strong developer.



>
> -- Ivan
>
> On 18 December 2011 18:42, Michael Snoyman  wrote:
> > On Sun, Dec 18, 2011 at 6:57 PM, Gracjan Polak 
> wrote:
> >>
> >> Hi all,
> >>
> >> The question 'How hard is it to start a technical startup with Haskell?'
> >> happened a couple of times on this list. Sometimes it was in the form
> 'How hard
> >> is to find Haskell programmers?' or 'Are there any Haskell jobs?'.
> >>
> >> I'd like to provide one data point as an answer:
> >>
> >>
> http://www.reddit.com/r/haskell/comments/ngbbp/haskell_only_esigning_startup_closes_second_angel/
> >>
> >> Full disclosure: I'm one of two that founded this startup.
> >>
> >> How are others doing businesses using Haskell doing these days?
> >
> > I don't run a startup myself, but I know of at least three startups
> > using Haskell for web development (through Yesod), and my company is
> > basing its new web products on Yesod as well. I think there are plenty
> > of highly qualified Haskell programmers out there, especially if
> > you're willing to let someone work remotely.
> >
> > Michael
> >
> > ___
> > Haskell-Cafe mailing list
> > Haskell-Cafe@haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
>
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>



-- 
Visi.Pro, Cloud Computing for the Rest of Us http://visi.pro
Lift, the simply functional web framework http://liftweb.net
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] If you'd design a Haskell-like language, what would you do different?

2011-12-19 Thread Gregory Crosswhite

On Dec 20, 2011, at 5:20 AM, Robert Clausecker wrote:

> What stuff would you add to your language

Gratuitous use of parentheses.

Cheers,
Greg___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] If you'd design a Haskell-like language, what would you do different?

2011-12-19 Thread David Fox
After eight years I'm still discovering why various decisions made in
Haskell are right.

On Mon, Dec 19, 2011 at 11:20 AM, Robert Clausecker wrote:

> Image you would create your own language with a paradigm similar to
> Haskell or have to chance to change Haskell without the need to keep any
> compatibility. What stuff would you add to your language, what stuff
> would you remove and what problems would you solve completely different?
>
> Thanks in advance for all answers, yours
>
>Robert Clausecker
>
>
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] If you'd design a Haskell-like language, what would you do different?

2011-12-19 Thread Mathijs Kwik
A mascot :)


On Mon, Dec 19, 2011 at 8:20 PM, Robert Clausecker  wrote:
> Image you would create your own language with a paradigm similar to
> Haskell or have to chance to change Haskell without the need to keep any
> compatibility. What stuff would you add to your language, what stuff
> would you remove and what problems would you solve completely different?
>
> Thanks in advance for all answers, yours
>
>        Robert Clausecker
>
>
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] If you'd design a Haskell-like language, what would you do different?

2011-12-19 Thread Robert Clausecker
Image you would create your own language with a paradigm similar to
Haskell or have to chance to change Haskell without the need to keep any
compatibility. What stuff would you add to your language, what stuff
would you remove and what problems would you solve completely different?

Thanks in advance for all answers, yours

Robert Clausecker


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Idiomatic Aeson

2011-12-19 Thread Oliver Charles
Hi, I'm not sure it directly helps, but I had a bit of trouble getting
off the ground with Aeson too. Here's some of my code using Aeson, maybe
there will be something in here that helps you?

https://github.com/ocharles/BookBrainz/blob/master/src/BookBrainz/Search.hs

- Ollie


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] compare lengths of lists lazily

2011-12-19 Thread Felipe Almeida Lessa
Hahaha, sweet! Had a good laugh with Henning's version.  Alexey's one
isn't as funny =).

-- 
Felipe.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] compare lengths of lists lazily

2011-12-19 Thread Alexey Khudyakov

On 19.12.2011 19:29, Henning Thielemann wrote:


Shortest and most obfuscating solution I found is:


import Data.Ord (comparing)
import Control.Applicative ((<$))

compareLength :: [a] -> [a] -> Ordering
compareLength = comparing (()<$)


comparingLength = comparing void

It's two character shorter

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Idiomatic Aeson

2011-12-19 Thread Rune Harder Bak
Hi

I'm trying to parse a nested structure using Aeson (from Facebook)

It looks something like this:

{ "education": [
{
"school": {
"name": "A"
},
},
{
"concentration": [
{
"name": "B"
}
}
]}

And besides this there is a lot of fields I don't need. (And a lot of
other fields I do need)

What is the idiomatic aeson way of doing this?

I'm using Aeson because it's fast, and it seams to have all the
relevant combinators, just can't get them to play nicely together.
I was thinking something like
getInfo (Object m) = (,) <$> m .: "school" .: "name" <*> mapM (.:
"name")  (m .: "concentracion")
but of cause the types don't add up.

the verbose style like
getInfo (Object m) = do
 school <- m .: "school"
 schoolName <- case school of
  Object m' -> m' .: "name"
  l -> typeMismatch "schoolName" l
 concentration <- m .: "concentration"
 concentrationName <- case concentration of
  Array l -> forM (V.toList l) $ \m' ->
case m' of
  Object m' -> m' .: "name"
  l -> typeMismatch "concentrationName" l
  )
   o -> typeMismatch "parseList" o
return (schoolName,concentrationName)
quickly explodes.

So I wrote my own functions of the following sort

parseName name _ (Object m) = m .: name
parseName _ err l = typeMismatch err l
parseList p (Array l) = mapM p $ V.toList l
parseList _ o = typeMismatch "parseList" o

so I can do something like
getInfo (Object m) = (,)
 <$> parseName "school "school" m >>= parseName "name" "schoolName"
 <*> parseName "concentration" "concentration" m >>= parseList
(parseName "name" "concentrationName")

And then variants for for .:?, but then it gets messy with >>= and maybe.
Getting rid of the m in the above I moved to arrows, and.. it seems
I'm not understanding the standard combinators.

So.. what is the idiomatic way of doing this in Aeson?

It shouldn't be necessary to move to template-haskell/generics to do this!

Thanks!

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] compare lengths of lists lazily

2011-12-19 Thread Henning Thielemann


Shortest and most obfuscating solution I found is:


import Data.Ord (comparing)
import Control.Applicative ((<$))

compareLength :: [a] -> [a] -> Ordering
compareLength = comparing (()<$)

:-)

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How hard is it to start a web startup using Haskell?

2011-12-19 Thread Yves Parès
> What you have posted here is essentially a job offer.

Actually I did not intended it to be so. It's too vague and I've other
things to do currently.
But actually I knew that when I'm ready to concretize something, then
*here*would be of course the place I'd look for interested (and
interesting ;) )
people.

> Let us know how many people get in contact with you in private just after
this single email.

One.

2011/12/19 Gracjan Polak 

> Yves Parès  gmail.com> writes:
>
> >
> >
> > Bryan O' Sullivans's company and Scrive may not be relevant examples, as
> they
> employ respectively people like, well... ^^ Bryan O'Sullivan and Magnus
> Carlsson
> (the Haskeller, not the singer).So you can expect such people to do
> wonders.
>
> You are what you create. Someday somebody will say same thing about you
> and your
> friend.
>
> ...or you will be famous singers.
>
> > But for instance I personally have one or two ideas of web development
> (and
> I'd love to carry them out using Yesod), but since I've simply been using
> Haskell for 2~3 years (and only as a hobby) and since the only guy I
> personally
> know who is the closest to a Haskeller is a friend who is beginning to
> read RWH.
>
> What you have posted here is essentially a job offer. Let us know how many
> people get in contact with you in private just after this single email.
>
> Explain your ideas on paper, I'm sure there are plenty of people that
> would like
> to help you out with your ideas. I know at least some myself.
>
> --
> Gracjan
>
>
>
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How hard is it to start a web startup using Haskell?

2011-12-19 Thread Erik Hesselink
At Silk [1] we use Haskell for the backend of our web application. The
frontend is Javascript with some functional aspects, and we have a
shallow ruby layer as a website (but not for the actual application).

Erik

[1] http://www.silkapp.com

On Mon, Dec 19, 2011 at 11:04, Ivan Perez  wrote:
> I'm actually trying to make a list of companies and people using Haskell
> for for-profit real world software development.
>
> I'd like to know the names of those startups, if possible.
>
> -- Ivan
>
> On 18 December 2011 18:42, Michael Snoyman  wrote:
>> On Sun, Dec 18, 2011 at 6:57 PM, Gracjan Polak  
>> wrote:
>>>
>>> Hi all,
>>>
>>> The question 'How hard is it to start a technical startup with Haskell?'
>>> happened a couple of times on this list. Sometimes it was in the form 'How 
>>> hard
>>> is to find Haskell programmers?' or 'Are there any Haskell jobs?'.
>>>
>>> I'd like to provide one data point as an answer:
>>>
>>> http://www.reddit.com/r/haskell/comments/ngbbp/haskell_only_esigning_startup_closes_second_angel/
>>>
>>> Full disclosure: I'm one of two that founded this startup.
>>>
>>> How are others doing businesses using Haskell doing these days?
>>
>> I don't run a startup myself, but I know of at least three startups
>> using Haskell for web development (through Yesod), and my company is
>> basing its new web products on Yesod as well. I think there are plenty
>> of highly qualified Haskell programmers out there, especially if
>> you're willing to let someone work remotely.
>>
>> Michael
>>
>> ___
>> Haskell-Cafe mailing list
>> Haskell-Cafe@haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How hard is it to start a web startup using Haskell?

2011-12-19 Thread Ivan Perez
I'm actually trying to make a list of companies and people using Haskell
for for-profit real world software development.

I'd like to know the names of those startups, if possible.

-- Ivan

On 18 December 2011 18:42, Michael Snoyman  wrote:
> On Sun, Dec 18, 2011 at 6:57 PM, Gracjan Polak  wrote:
>>
>> Hi all,
>>
>> The question 'How hard is it to start a technical startup with Haskell?'
>> happened a couple of times on this list. Sometimes it was in the form 'How 
>> hard
>> is to find Haskell programmers?' or 'Are there any Haskell jobs?'.
>>
>> I'd like to provide one data point as an answer:
>>
>> http://www.reddit.com/r/haskell/comments/ngbbp/haskell_only_esigning_startup_closes_second_angel/
>>
>> Full disclosure: I'm one of two that founded this startup.
>>
>> How are others doing businesses using Haskell doing these days?
>
> I don't run a startup myself, but I know of at least three startups
> using Haskell for web development (through Yesod), and my company is
> basing its new web products on Yesod as well. I think there are plenty
> of highly qualified Haskell programmers out there, especially if
> you're willing to let someone work remotely.
>
> Michael
>
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How hard is it to start a web startup using Haskell?

2011-12-19 Thread Gracjan Polak
Yves Parès  gmail.com> writes:

> 
> 
> Bryan O' Sullivans's company and Scrive may not be relevant examples, as they
employ respectively people like, well... ^^ Bryan O'Sullivan and Magnus Carlsson
(the Haskeller, not the singer).So you can expect such people to do wonders.

You are what you create. Someday somebody will say same thing about you and your
friend.

...or you will be famous singers.

> But for instance I personally have one or two ideas of web development (and
I'd love to carry them out using Yesod), but since I've simply been using
Haskell for 2~3 years (and only as a hobby) and since the only guy I personally
know who is the closest to a Haskeller is a friend who is beginning to read RWH.

What you have posted here is essentially a job offer. Let us know how many
people get in contact with you in private just after this single email.

Explain your ideas on paper, I'm sure there are plenty of people that would like
to help you out with your ideas. I know at least some myself.

-- 
Gracjan



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] PEPM'12 - second call for participation

2011-12-19 Thread Simon Thompson

ACM SIGPLAN 2012 Workshop on Partial Evaluation and Program Manipulation
  http://www.program-transformation.org/PEPM12

January 23-24, 2012. Philadelphia, PA, USA (co-located with POPL'12)

   Second Call For Participation

   Online registration is open at 
   https://regmaster3.com/2012conf/POPL12/register.php
   Early registration deadline is December 24, 2011

   Program is now available
   http://www.program-transformation.org/PEPM12/Program


The PEPM Symposium/Workshop series brings together researchers
and practitioners working in the broad area of program
transformation, which spans from refactoring, partial evaluation,
supercompilation, fusion and other metaprogramming to model-driven
development, program analyses including termination, inductive
programming, program generation and applications of machine learning 
and probabilistic search. PEPM focuses on techniques, supporting
theory, tools, and applications of the analysis and manipulation of
programs. 

In addition to the presentations of regular research papers, the PEPM
program includes tool demonstrations and `short paper' presentations
of exciting if not fully polished research.

PEPM has established a Best Paper award. The winner will be 
announced at the workshop.


INVITED TALKS

Compiling Math to High Performance Code
  Markus Pueschel (ETH Zuerich, Switzerland)
  http://www.inf.ethz.ch/~markusp/index.html


Specification and verification of meta-programs
  Martin Berger (University of Sussex, UK)
  http://www.informatics.sussex.ac.uk/users/mfb21/

VENUE

The conference is co-located with POPL and will be held at
the Sheraton Society Hill Hotel in Philadelphia's historic district.
For hotel rate details and booking please see the POPL webpage:
  http://www.cse.psu.edu/popl/12/




Simon Thompson | Professor of Logic and Computation 
School of Computing | University of Kent | Canterbury, CT2 7NF, UK
s.j.thomp...@kent.ac.uk | M +44 7986 085754 | W www.cs.kent.ac.uk/~sjt


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe