[Haskell-cafe] ANNOUNCE: rethinkdb 0.1.0

2012-11-23 Thread Etienne Laurin
Greetings,

I am pleased to announce a Haskell client library for RethinkDB[1].
RethinkDB[2] is a newly released, open source, distributed database.
Its simple yet powerful API seemed well suited to be accessed from a
language like Haskell. This haskell library is modelled upon the
existing Javascript and Python API and adds static type checking.

Here is an example from the RethinkDB javascript tutorial[3] ported to Haskell:

run h $ orderBy [reduction]
   . groupedMapReduce (! Stname) mapF (0 :: NumberExpr) (R.+)
   . filter' filterF
   . pluck [Stname, POPESTIMATE2011, Dem, GOP]
   . zip'
   $ eqJoin (table county_stats) Stname (table polls)

   where mapF doc = ((doc ! POPESTIMATE2011) R.*
 ((doc ! GOP) R.- (doc ! Dem))) R./ (100 :: Int)
 filterF doc = let dem = doc ! Dem :: NumberExpr; gop =
doc ! GOP in
   (dem R. gop) `and'` ((gop R.- dem) R.
(15::Int))

What is the advantage of RethinkDB? [4]

What's really special about all RethinkDB queries is that the program
you wrote gets sent to the server, broken up into chunks, sent to
relevant shards, executed completely in parallel (to the degree that
the query makes possible -- complex queries often have multiple
parallelization and recombination stages), but as a user you don't
have to care about that at all. You just get the results.

[...]

Of course the visceral experience you get from using RethinkDB isn't
just about the query language, or parallelization, or pleasant client
libraries. It's about hundreds upon hundreds of examples like it, some
large, some small, that add up to a completely different product. The
team is fastidious about every command, every pixel, every algorithm,
sometimes even every assembly instruction, so that people can use the
product and at every step say `Wow, I can't believe how easy this was,
how do they do that?!!' 

I hope this library can help other Haskell programmers use this new database.

Etienne Laurin

[1] http://hackage.haskell.org/package/rethinkdb
[2] http://www.rethinkdb.com
[3] http://www.rethinkdb.com/docs/tutorials/elections/
[4] 
http://www.quora.com/RethinkDB/What-is-the-advantage-of-RethinkDB-over-MongoDB

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


Re: [Haskell-cafe] ANNOUNCE: rethinkdb 0.1.0

2012-11-23 Thread Etienne Laurin
 http://www.quora.com/RethinkDB/What-is-the-advantage-of-RethinkDB-over-MongoDB

 How about a URL for those who prefer not to be sold by Facebook?

Sorry I did not realise there was an intrusive login dialog on that
page. You can click on the close link in the login dialog to view
the content of the page.

Etienne Laurin

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


Re: [Haskell-cafe] Fundeps and overlapping instances

2012-06-04 Thread Etienne Laurin
 | Abandoning fundeps would be a sad day for type-level programming.
 | There are many things other than overlaps that you can do with fundeps
 | and constraint kinds that you cannot currently do with type families,
 | such as:
 |
 | - Partial application or higher-order programming.
 | - Short-circuit evaluation, lazy evaluation or type-level case.

 Etienne, I think it would be a good service to make Haskell wiki page
 describing the difference between
 fundeps and type families, and in particular describing things that can be
 done with the former but not the latter.


 Simon

Thanks for the idea. Here it is.

http://hackage.haskell.org/trac/ghc/wiki/TFvsFD

I posted my comments on the matter along with many additional comments
and examples that I found.

 +1 That would be great. I'll link to Etienne's wiki from the Discussion page
 I've started for NewAxioms http://hackage.haskell.org/trac/ghc/wiki/NewAxioms

 In particular, it would be good to tease out where we're getting interference
 or inter-dependence between different type-level extensions:
    Overlaps
    Fundeps
    UndecidableInstances (that is, breaking the coverage conditions)
    ScopedTypeVariables

I did not check what extensions were turned on in my examples.

 Given that that the Fundeps idea is taken from relational theory, and
 relations is just another way of representing functions, there ought to be
 close correspondence to type-level functions.

I put a few examples of the unexpected behaviour of Fundeps on the Wiki page.

 To me, NewAxioms is aiming at type-level case, to provide a different style of
 defining type functions, as well as dis-overlapping overlaps.

I am eager to see that in action.

Etienne Laurin

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


Re: [Haskell-cafe] Fundeps and overlapping instances

2012-06-01 Thread Etienne Laurin
Hello,

2012/6/1 Iavor Diatchki iavor.diatc...@gmail.com:
 There is no problem if an instances uses a type family in it's
 assumption---the instances should be accepted only if GHC can see enough of
 the definition of the type family to ensure that the functional dependency
 holds.  This is exactly the same as what it would do to check that a super
 class constraint holds.

GHC cannot see enough of the definition because type families are
open. The type instances are not guaranteed to all be in scope when
the class instance is defined.

2012/6/1 AntC anthony_clay...@clear.net.nz:
 Some of Oleg's instances are awesome (and almost impenetrable -- the TTypeable
 code is a tour de force).

 It's all so *dys-functional* (IMO).

It's like a typed Prolog with a different order of evaluation.

 My take is that we should abandon Fundeps, and concentrate on introducing
 overlaps into type functions in a controlled way (what I've called 'dis-
 overlapped overlaps'.)

Abandoning fundeps would be a sad day for type-level programming.
There are many things other than overlaps that you can do with fundeps
and constraint kinds that you cannot currently do with type families,
such as:

- Partial application or higher-order programming.
- Short-circuit evaluation, lazy evaluation or type-level case.

To study the differences, I have been porting parts of the Prelude to
both type classes and type families.

http://code.atnnn.com/projects/type-prelude/repository/entry/Prelude/Type.hs
http://code.atnnn.com/projects/type-prelude/repository/entry/Prelude/Type/Families.hs

Etienne Laurin

 On Wed, May 30, 2012 at 11:14 PM, Etienne Laurin etie...@atnnn.com wrote:
  1. Check that an instance is consistent with itself.  For example, this
  should be rejected:
 
  instance C a b
 
  because it allows C Int Bool and C Int Char which violate the functional
  dependency.

 This check may not always be as straightforward. When would this be a
 valid instance?

 instance K a b ⇒ C a b

 With a few extra extensions, K could be a type family.

 C currently has the kind (a - b - Constraint), with no mention of
 functional dependencies. Perhaps the kind of C should include the
 functional dependencies of C?

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


Re: [Haskell-cafe] Fundeps and overlapping instances

2012-05-31 Thread Etienne Laurin
2012/5/31 Iavor Diatchki iavor.diatc...@gmail.com:
 Hello,

 the notion of a functional dependency is well established, and it was used
 well before it was introduced to Haskell (for example, take a look
 at http://en.wikipedia.org/wiki/Functional_dependency).  So I'd be weary to
 redefine it lightly.

Indeed, GHC's functional dependencies are not the same. I see you have
already talked about this on the GHC bug tracker.

http://hackage.haskell.org/trac/ghc/ticket/1241

 1. Check that an instance is consistent with itself.  For example, this 
 should be rejected:

 instance C a b

 because it allows C Int Bool and C Int Char which violate the functional 
 dependency.

This check may not always be as straightforward. When would this be a
valid instance?

instance K a b ⇒ C a b

With a few extra extensions, K could be a type family.

C currently has the kind (a - b - Constraint), with no mention of
functional dependencies. Perhaps the kind of C should include the
functional dependencies of C?

Etienne Laurin

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


Re: [Haskell-cafe] Fundeps and overlapping instances

2012-05-30 Thread Etienne Laurin
Hello,

I disagree with your example.

 1. Check that an instance is consistent with itself.  For example, this
 should be rejected:

 instance C a b

 because it allows C Int Bool and C Int Char which violate the functional
 dependency.

Functional dependencies are not used to pick types, they are used to
pick instances.

class C a b | a → b where
  k ∷ a
  f ∷ a → Maybe b

The functional dependency allows you to have a method such as k that
doesn't use all the arguments of the class.

I expect to be able to make a instance that works for any b.

instance C Int b where
  k = 2
  f _ = Nothing

Etienne Laurin

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


[Haskell-cafe] ANN: cabal-ghci 0.1

2011-09-09 Thread Etienne Laurin
Hello fellow hackers.

Here is a helpful package I wrote to ease the development of projects
using cabal.

It includes a :cabalset ghci command to set ghci options for your
project, and a cabal-ghci executable to launch ghci with those
options.

Do you get errors when loading your project into ghci?

Prelude a ← return 1
interactive:1:3: Not in scope: `←'

Prelude :load Main
Could not find module `Main':
  it is not a module in the current program, or in any known package.

cabalset fixes these problems for you.

Prelude :cabalset
:set -i/home/atnnn/up1/src/dist/build/autogen
:set -i/home/atnnn/up1/src/web
:set -XUnicodeSyntax
:set -Wall

Prelude a ← return 1
interactive:1:12:
Warning: Defaulting the following constraint(s) to type `Integer'
   (Num t0) arising from the literal `1'

Prelude :load Main
Ok, modules loaded: Main, Application, Handlers.

This works from any sub-directory of your project and accepts the
following arguments:
-fflagenable flag
-f-flag   disable flag
exec  load options for the exec executable

To install:
$ cabal update
$ cabal install cabal-ghci
$ cat  ~/.ghci
:m + Distribution.Dev.Interactive
:def cabalset cabalSet
:cabalset
:m - Distribution.Dev.Interactive
^D

Etienne Laurin

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


Re: [Haskell-cafe] ANN: cabal-ghci 0.1

2011-09-09 Thread Etienne Laurin
 Here is a helpful package I wrote to ease the development of projects
 using cabal.

 Is :cabalset custom per project or could I put the same things in my ~/.ghci?

Everytime I run :cabalset or cabal-ghci, it looks for a .cabal file in
my current directory or any of its parents, it loads the cabal file
and it generates a list of ghci options for that project.

 Did you know that cabal-dev supports loading your project into ghci?

Yes :)

Sadly, some of my test and build scripts don't yet work with cabal-dev.

 (I'm trying to understand how cabal-ghci is different than existing tools.)

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


Re: [Haskell-cafe] ANN: cabal-ghci 0.1

2011-09-09 Thread Etienne Laurin
 thank you very much for this helpful tool!

:)

 I notice that Haddock has trouble parsing the documentation:

  http://hackage.haskell.org/packages/archive/cabal-ghci/0.1/logs/failure/ghc-7.2

 Is that error hard to fix?

I have uploaded a new version of the source with haddock documentation.

Etienne Laurin

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


Re: [Haskell-cafe] Input and output of mathematical expressions

2011-06-09 Thread Etienne Laurin
Henning Thielemann lemming at henning-thielemann.de writes:
 On Thu, 9 Jun 2011, Jacek Generowicz wrote:
 On 2011 Jun 9, at 16:59, Chris Smith wrote:

 Ae you looking to do this in a web application, or client-side?  Since one 
 of your requirements is to display a typeset equation, that makes a bit of 
 difference.  In a web-based setting, the best way to do that is probably 
 MathML, whereas a GUI will be a bit harder.
 
 Yes, this pretty much summarizes my (ignorant) thoughts on it so far (GUI: 
 hard; MathML: relatively easy), which is why I suspect that running it as a 
 local web application might be the simplest way to go.
 
 Concerning a local GUI: How about running LaTeX for Tex-PDF, generate a 
 PNG from PDF by ghostscript and show the PNG?

I am working on an alternative solution for a local GUI. I am developing an 
equation editor and manipulator in Haskell, using gtk2hs. A prototype is 
available on Hackage as casui.

Etienne Laurin


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


[Haskell-cafe] [GSoC] Parallel Benchmarking and Profiling

2008-03-24 Thread Etienne Laurin
Hello,

I am putting together a student proposal to participate in Google's
Summer of Code with one of the following project ideas.

Parallel programming benchmarking and benchmark suite
- http://hackage.haskell.org/trac/summer-of-code/ticket/1544

Are there open source projects and real world applications that rely
on GHC's parrallel programming primitives and libraries? I have found
many references to LOLITA, but it seems to be old and not available
online. The idea page suggests porting existing benchmark suites such
as PARSEC, but PARSEC is 5G of C code. Most of it seems to come from
existing applications already written in C. It might also be
interesting to automate the discovery of optimal strategies through
empirical data, and to modify the thresholds dynamically.

Parallel profiling tools for GHC
- http://hackage.haskell.org/trac/summer-of-code/ticket/1559

Simon Marlow wrote on the idea page that Gransim was ported to a more
up-to-date GHC. The documentation available on the web seems to be for
GHC 0.29 but it describes many options for logging and visualising the
activity of threads and processors over time. Getting GHC to display
that information on the frontpanel would make a nice project.

Do you have any comments or suggestions?

Thank you,

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