[Haskell-cafe] Probabilistic functional programming with Baysig/BayesHive

2013-07-09 Thread Tom Nielsen
a few videos: http://bayeshive.com Baysig quick tour (QuickBAYSIG): http://bayeshive.com/helppage/Baysig%20quick%20tour:%20fundamentals More documentation: http://bayeshive.com/help Regards, Tom Nielsen OpenBrain Ltd. ___ Haskell-Cafe mailing list Haskell

Re: [Haskell-cafe] 3 level hierarchy of Haskell objects

2012-08-09 Thread Tom Nielsen
Hello, On Thu, Aug 9, 2012 at 1:52 PM, Tillmann Rendel ren...@informatik.uni-marburg.de wrote: Note that many type classes in Haskell have equations annotated as comments. For example, the monad laws are mentioned in the documentation of the Monad type class: One of the reasons why I chose

[Haskell-cafe] Data.Array.Unboxed in GHC 7.4

2012-05-22 Thread Tom Nielsen
Dear cafe, I have just upgraded to GHC 7.4, and now I run into some compilation problems. Specifically, I have a package that needs both Data.Array.Unboxed and System.IO.Unsafe. But I cannot enable both base and haskell98 in a cabal file. is there any way out of this? If I enable both haskell98

Re: [Haskell-cafe] Data.Array.Unboxed in GHC 7.4

2012-05-22 Thread Tom Nielsen
Apologies, I fixed this. It only affects the really old Array module, which I can live without. Data.Array.Unboxed is fine. Tom On Tue, May 22, 2012 at 10:41 AM, Tom Nielsen taniel...@gmail.com wrote: Dear cafe, I have just upgraded to GHC 7.4, and now I run into some compilation problems

Re: [Haskell-cafe] How can I get rid of this link error?

2011-11-11 Thread Tom Nielsen
have you tried cabal clean before cabal install ? Tom On Fri, Nov 11, 2011 at 12:06 PM, Amy de Buitléir a...@nualeargais.ie wrote: I wrote a library called AmysGeometry. The only modules in it (so far) are: Amy/Geometry/ThreeD.hs Amy/Geometry/UnitSphere.hs The library compiles just fine,

Re: [Haskell-cafe] Data.Vector.Unboxed

2011-11-09 Thread Tom Nielsen
Hi, I don't know about Unboxed, but you can define a newtype wrapper around Data.Vector.Storable that includes the size as a type-level natural. i.e. data Z data S n newtype Vec n a = Vec (Vector a) Then you can define a storable instance for Storable a = Vec n a, and thus you can define a

[Haskell-cafe] Science, FRP and Haskell

2011-10-06 Thread Tom Nielsen
Dear cafe, I am please to announce that our paper on using FRP (and Haskell!) in physiological experimentation and analysis has now been published in Journal of the Royal Society Interface. Since most people on this list probably don't read that journal on a regular basis, I thought a quick note

Re: [Haskell-cafe] Reactive Programming in Machine Learning

2011-07-23 Thread Tom Nielsen
As far as I am aware, there has been very little work on combining these two, but that does not mean that it is a bad idea. I can give you some pointers from a very personal perspective: -Machine learning is mostly kernel methods and probabilistic inference, I can't really say much about how one

Re: [Haskell-cafe] Uncertainty analysis library?

2011-03-21 Thread Tom Nielsen
The danger here is, of course, the side-condition of independence, which can make inhabitants of that type very difficult to reason about. e.g. x + x and 2*x in that world are very different. Yes. I was surprised (maybe i shouldn't have been): sampler = do x - gauss 0.0 1.0 y - gauss 0.0

Re: [Haskell-cafe] Parsing Haskell in Parsec

2011-03-20 Thread Tom Nielsen
I'm writing the parser for a Haskell-like language in Parsec https://github.com/glutamate/baysig/blob/master/Baysig/Syntax/Parser.hs The hand-written lexer and layout resolution code is in the same directory. It has do-notation and custom infix declarations. Tom On Sun, Mar 20, 2011 at 5:25

Re: [Haskell-cafe] Uncertainty analysis library?

2011-03-20 Thread Tom Nielsen
Interval arithmetic is of course not the same as uncertainty, although computer scientists like to pretend that is the case. (and uncertainty estimates do not have the be rough.) In general the propagation of errors depends on whether the errors are independent or not. The rules are given in

Re: [Haskell-cafe] Uncertainty analysis library?

2011-03-20 Thread Tom Nielsen
PM, Tom Nielsen taniel...@gmail.com wrote: Interval arithmetic is of course not the same as uncertainty, although computer scientists like to pretend that is the case. (and uncertainty estimates do not have the be rough.) In general the propagation of errors depends on whether the errors

Re: [Haskell-cafe] problem with instance method

2011-02-03 Thread Tom Nielsen
No, obj is a method of the Objects class. you've already declared it in the instance of Objects Object your code works just fine here. adding: mycar = Car Blue o:: Object Car Integer o = obj mycar 4 ghci says... *Objects :t obj obj :: (Objects o t i) = t - i - o t i *Objects o Obj (Car

Re: [Haskell-cafe] Instantiation problem

2011-01-31 Thread Tom Nielsen
Patrick, I find Andrew Frank's work on axiomatic specifications of GIS systems -- which the paper you cite is built on -- very confusing, or indeed, confused. They have a bunch of example like data Car = Car Color class Car a where carColor :: a - Color instance Car Car where carColor

Re: [Haskell-cafe] typesetting with lhs2tex

2010-12-16 Thread Tom Nielsen
I think you have to do it yourself. lhs2TeX isn't that clever - it doesn't really know haskell syntax, it just applies some very simple transformation rules. e.g. change runE :: Monad m = Enumerator e s m - m r - (e - m r) - (s - Enumerator e s m - m r) - m r to runE :: Monad m =  Enumerator e

Re: [Haskell-cafe] Rather off topic: An ab initio universe simulation?

2010-12-09 Thread Tom Nielsen
You can do all sorts of fun things with computers. Assuming that you are interested in modeling really real life, how will you estimate parameters (e.g. mutation rates) based on real data? How will you quantify whether this a good or a bad model? I think living in a fact-free world is a bit

Re: [Haskell-cafe] Rather off topic: An ab initio universe simulation?

2010-12-09 Thread Tom Nielsen
Have you read: Fontana Buss : What would be conserved if 'the tape were played twice'? in PNAS? It's quite fun - they model chemical reaction as alpha-reduction in the lambda calculus and look at evolution. Tom On Thu, Dec 9, 2010 at 10:15 PM, Ketil Malde ke...@malde.org wrote: Michael Lesniak

[Haskell-cafe] warn-incomplete-patterns and GADTs

2010-08-27 Thread Tom Nielsen
Hi, is warn-incomplete-patterns (in GHC 6.10.3) less clever than it could be? {-# OPTIONS_GHC -fglasgow-exts #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} module Vec where data Z data S a data Vec n a where VNil :: Vec Z a VCons :: a - Vec m a - Vec (S m) a instance Eq a = Eq (Vec

Re: [Haskell-cafe] Devices and Webcams, The Basics

2010-05-20 Thread Tom Nielsen
OpenCV and its Haskell bindings http://hackage.haskell.org/package/HOpenCV should be able to talk to a webcam. There's an O'Reilly book about OpenCV. Tom On Wed, May 19, 2010 at 10:06 PM, Eitan Goldshtrom thesource...@gmail.com wrote: Hi everyone, I would like to start working on a program

Re: [Haskell-cafe] Is Haskell capable of matching C in string processing performance?

2010-01-22 Thread Tom Nielsen
It seems to me this indicates that the big expense here is the call into the I/O system. So let's make fewer I/O calls: import Control.Monad import qualified Data.ByteString.Char8 as S import System.IO null_str1 = S.concat $ take 1000 $ repeat $ S.pack null n1 = 500 `div` 1000 main =

Re: [Haskell-cafe] Testing for statistical properties

2010-01-08 Thread Tom Nielsen
Hi Greg, Assuming this is a one-dimensional distribtution, you should use a kolmogorov-smirnov test to test this: http://en.wikipedia.org/wiki/Kolmogorov-Smirnov_test I've implemented to the KS distribution from the CERN code linked in the wikipedia article, here:

Re: [Haskell-cafe] unboxed arrays restricted to simple types (Int, Float, ..)

2009-11-11 Thread Tom Nielsen
There's a couple of things going on here: -If you use storablevector and storable-tuple, or uvector, you can store tuples of things. So your stupidArrayElement could be mimicked by (Int, Int). -But what you want to do is store a variable-sized data type. How would you do that in C? If you can

Re: [Haskell-cafe] Hopefully simple monad question

2009-09-16 Thread Tom Nielsen
newtype VMT m a =  VMT {runVMT :: StateT VMState m a}    deriving (Monad, MonadIO, MonadTrans, TransM, MonadState VMState) works here (ghc-6.10.3) On Wed, Sep 16, 2009 at 11:42 AM, Miguel Mitrofanov miguelim...@yandex.ru wrote: newtype VMT m a =  VMT {runVMT :: StateT VMState m a}    

Re: [Haskell-cafe] Typeclasses vs simple functions?

2009-09-15 Thread Tom Nielsen
I think you are in trouble because you have mixed 2D and 3D shapes in one data type. --not checked for typos, syntax, idiocy etc. {-# LANGUAGE GADTs #-} data Z data S n type Two = S (S Z) type Three = S Two data Geometry dims where Sphere :: Position - Radius - Geometry Three Cylinder

Re: [Haskell-cafe] Searching for ADT patterns with elem and find

2008-11-12 Thread Tom Nielsen
somebody pointed out a few months back that list comprehensions do this nicely: containsTypeB ts = not $ null [x | (B x) - ts] no need for defining isTypeB. not quite sure how you would write findBs :: [T]-[T] succinctly; maybe findBs ts = [b | b@(B _) - ts] or findBs ts = [B x | (B x) -

Re: [Haskell-cafe] Currying function using values from array

2008-08-07 Thread Tom Nielsen
Maybe you want something like curryWithList :: ([a]-b)-[a]-([a]-b) curryWithList f lst1= \lst2 -f (lst1++lst2) addThemUp = sum curried = curryWithList addThemUp [1,2,3,4] curried [5] =15 On Thu, Aug 7, 2008 at 8:35 PM, Henning Thielemann [EMAIL PROTECTED] wrote: On Thu, 7 Aug 2008, Sukit

[Haskell-cafe] Analog data acquisition

2008-05-13 Thread Tom Nielsen
Hello, I would like to use a lazy, purely functional language to create an experiement description (and execution!) language for cellular neuroscience, i.e. electrical recordings and stimulation. Unfortunately, this means I have to talk to a Analog-to-Digital/Digital-to-Analog converter board,

Re: [Haskell-cafe] Analog data acquisition

2008-05-13 Thread Tom Nielsen
Yes. I guess I have to wait for chapter 19, then? Tom On Tue, May 13, 2008 at 7:35 PM, Don Stewart [EMAIL PROTECTED] wrote: tanielsen: Hello, I would like to use a lazy, purely functional language to create an experiement description (and execution!) language for cellular