Re: [Haskell-cafe] Fwd: [Haskell-beginners] Monad instances and type synonyms
On Sun, Apr 14, 2013 at 5:10 PM, Christopher Howard christopher.how...@frigidcode.com wrote: type Adjustment a = SaleVariables - a [...] instance Monad Adjustment where (=) = ... return = ... Essentially, you can't partially apply type synonyms. I don't recall the exact reasoning, but if this sort of thing was allowed it would probably poke funny holes in the type system. Also, Control.Monad.Instances already supplies a Monad instance for functions (r - a). So even if that did pass, you'd bump into overlapping instances anyway. Chris If I try this, I get code: Type synonym `Adjustment' should have 1 argument, but has been given none In the instance declaration for `Monad Adjustment' But if I give an argument, then it doesn't compile either (it becomes a * kind). And I didn't want to make the type with a regular data declaration either, because then I have to give it a constructor, which doesn't fit with what I want the type to do. -- frigidcode.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Chris Wong, fixpoint conjurer e: lambda.fa...@gmail.com w: http://lfairy.github.io/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] NaN as Integer value
On 4/13/13 1:18 PM, Jerzy Karczmarczuk wrote: This is not a Haskell problem. For Ints, ALL representations are valid numbers, a NaN is a specific float object, unless I'm mistaken, so the introduction of such an abnormal number would require some serious modifications of the representation. Also, the necessity of NaN for floats comes from the fact that floats include values for Infinity and -Infinity, which leads to various equations which cannot be resolved sensibly. This is different than mere undefinedness. Undefined values are underspecified, but that can often be resolved by choosing some arbitrary specification (often chosen via arguing from limits or combinatorial convenience). Whereas the problematic values due to infinities are overspecified, so no matter which answer you pick it's guaranteed to be the wrong answer half the time. Part of this whole problem comes from the fact that floats *do* decide to give a meaning to 1/0 (namely Infinity). That's the gateway drug,... -- Live well, ~wren ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Fwd: [Haskell-beginners] Monad instances and type synonyms
It does not really make sense to make a type synonym an instance of some class, because a type synonym is just just what is says -- another name for some type. So making a type synonym for some type T an instance of a class would be the same as making T itself an instance of the class. Typically you would make Adjustment its own type using newtype: newtype Adjustment a = Adjustment (SaleVariables - a) Ofcourse now it needs its own constructor (like you said you don't want it to). /Johan 2013/4/14 Christopher Howard christopher.how...@frigidcode.com I asked this question in Haskell-beginners, but I haven't heard anything yet, so I'm forwarding to Cafe. Original Message Subject: [Haskell-beginners] Monad instances and type synonyms Date: Sat, 13 Apr 2013 17:03:57 -0800 From: Christopher Howard christopher.how...@frigidcode.com Reply-To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell beginn...@haskell.org To: Haskell Beginners beginn...@haskell.org I am playing around with some trivial code (for learning purposes) I wanted to take code: -- SaleVariables a concrete type defined early -- `Adjustment' represents adjustment in a price calculation -- Allows functions of type (a - Adjustment a) to be composed -- with an appropriate composition function type Adjustment a = SaleVariables - a And put it into code: instance Monad Adjustment where (=) = ... return = ... If I try this, I get code: Type synonym `Adjustment' should have 1 argument, but has been given none In the instance declaration for `Monad Adjustment' But if I give an argument, then it doesn't compile either (it becomes a * kind). And I didn't want to make the type with a regular data declaration either, because then I have to give it a constructor, which doesn't fit with what I want the type to do. -- frigidcode.com ___ 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] Fwd: [Haskell-beginners] Monad instances and type synonyms
On Sun, Apr 14, 2013 at 9:28 AM, Chris Wong chrisyco+haskell-c...@gmail.com wrote: On Sun, Apr 14, 2013 at 5:10 PM, Christopher Howard christopher.how...@frigidcode.com wrote: type Adjustment a = SaleVariables - a [...] instance Monad Adjustment where (=) = ... return = ... Essentially, you can't partially apply type synonyms. I don't recall the exact reasoning, but if this sort of thing was allowed it would probably poke funny holes in the type system. Also, Control.Monad.Instances already supplies a Monad instance for functions (r - a). So even if that did pass, you'd bump into overlapping instances anyway. The fact that that instance exists shows that you can define an instance like this (even though you don't have to, since it already exists). The trick is to define the type synonym partially applied. When you do that, you can define the instance: type Adjustment = (-) SaleVariables instance Monad Adjustment where Note that this needs the extensions TypeSynonymInstances and FlexibleInstances. Erik. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Fwd: [Haskell-beginners] Monad instances and type synonyms
Maybe you can try curried definition: type Adjustment = (-) SaleVariables I had a similar problem awhile ago. Hth — On Sun, Apr 14, 2013 at 9:11 AM, Christopher Howard christopher.how...@frigidcode.com=mailto:christopher.how...@frigidcode.com; wrote: I asked this question in Haskell-beginners, but I haven't heard anything yet, so I'm forwarding to Cafe. Original Message Subject: [Haskell-beginners] Monad instances and type synonyms Date: Sat, 13 Apr 2013 17:03:57 -0800 From: Christopher Howard christopher.how...@frigidcode.com Reply-To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell beginn...@haskell.org To: Haskell Beginners beginn...@haskell.org I am playing around with some trivial code (for learning purposes) I wanted to take code: -- SaleVariables a concrete type defined early -- `Adjustment' represents adjustment in a price calculation -- Allows functions of type (a - Adjustment a) to be composed -- with an appropriate composition function type Adjustment a = SaleVariables - a And put it into code: instance Monad Adjustment where (=) = ... return = ... If I try this, I get code: Type synonym `Adjustment' should have 1 argument, but has been given none In the instance declaration for `Monad Adjustment' But if I give an argument, then it doesn't compile either (it becomes a * kind). And I didn't want to make the type with a regular data declaration either, because then I have to give it a constructor, which doesn't fit with what I want the type to do. -- frigidcode.com Attached Message Part___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Fwd: [Haskell-beginners] Monad instances and type synonyms
Oh, I see that I'm late to the party, sorry, wasn't able to push my mail for some time — On Sun, Apr 14, 2013 at 3:09 PM, Daniil Frumin difru...@gmail.com wrote: Maybe you can try curried definition: type Adjustment = (-) SaleVariables I had a similar problem awhile ago. Hth — On Sun, Apr 14, 2013 at 9:11 AM, Christopher Howard christopher.how...@frigidcode.com=mailto:christopher.how...@frigidcode.com; wrote: I asked this question in Haskell-beginners, but I haven't heard anything yet, so I'm forwarding to Cafe. Original Message Subject: [Haskell-beginners] Monad instances and type synonyms Date: Sat, 13 Apr 2013 17:03:57 -0800 From: Christopher Howard christopher.how...@frigidcode.com Reply-To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell beginn...@haskell.org To: Haskell Beginners beginn...@haskell.org I am playing around with some trivial code (for learning purposes) I wanted to take code: -- SaleVariables a concrete type defined early -- `Adjustment' represents adjustment in a price calculation -- Allows functions of type (a - Adjustment a) to be composed -- with an appropriate composition function type Adjustment a = SaleVariables - a And put it into code: instance Monad Adjustment where (=) = ... return = ... If I try this, I get code: Type synonym `Adjustment' should have 1 argument, but has been given none In the instance declaration for `Monad Adjustment' But if I give an argument, then it doesn't compile either (it becomes a * kind). And I didn't want to make the type with a regular data declaration either, because then I have to give it a constructor, which doesn't fit with what I want the type to do. -- frigidcode.com Attached Message Part___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Fwd: [Haskell-beginners] Monad instances and type synonyms
The point in not allowing partially applied type synonym instances is that it'd make deciding whether a type is an instance of a class much harder. Cf. here[1] for a similar question with the Category class. -- Steffen [1] Attached message. Couldn't find it on the archives.. On 04/14/2013 07:10 AM, Christopher Howard wrote: I asked this question in Haskell-beginners, but I haven't heard anything yet, so I'm forwarding to Cafe. Original Message Subject: [Haskell-beginners] Monad instances and type synonyms Date: Sat, 13 Apr 2013 17:03:57 -0800 From: Christopher Howardchristopher.how...@frigidcode.com Reply-To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskellbeginn...@haskell.org To: Haskell Beginnersbeginn...@haskell.org I am playing around with some trivial code (for learning purposes) I wanted to take code: -- SaleVariables a concrete type defined early -- `Adjustment' represents adjustment in a price calculation -- Allows functions of type (a - Adjustment a) to be composed -- with an appropriate composition function type Adjustment a = SaleVariables - a And put it into code: instance Monad Adjustment where (=) = ... return = ... If I try this, I get code: Type synonym `Adjustment' should have 1 argument, but has been given none In the instance declaration for `Monad Adjustment' But if I give an argument, then it doesn't compile either (it becomes a * kind). And I didn't want to make the type with a regular data declaration either, because then I have to give it a constructor, which doesn't fit with what I want the type to do. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ---BeginMessage--- Hi Markus, On 07/06/2011 03:04 PM, Markus Läll wrote: [...] import Control.Arrow import Control.Category type X a b = [a] - [b] instance Category X where id = map Prelude.id g . f = g Prelude.. f instance Arrow X where arr f = map f first f = unzip first f uncurry zip The problem is that it's not allowed to use partially applied type synonyms. It is however possible to define a type synonym which value is a partially applied type, but I haven't been able to figure out if I could somehow use that fact in defining the X... Is it at all possible, or is a newtype the only way to do it? You should really use a newtype for that. Allowing partially applied type synonyms would greatly increase the expressiveness of the type language. (too much, actually) In fact, you could write arbitrary type level lambdas, like that: type Y b a = [a] - [b] But now, given instances like this: instance Category X where ... instance Category Y where ... -- uh, yeah, does it make sense in this case? Whatever, we *could* have an instance. , any function of type [a] - [b] will match both instances. So which instance to choose? We have two solutions: a) The compiler discovers itself that we have overlaps here and complains. This seems hard to me (is it even possible in finite time?). Note that it is easy if type synonyms are always fully applied because the compiler just has to fill in the definition of all the types and can then proceed to compare just the instance *heads*. b) You somehow annotate which instance to choose for each specific case. But that's exactly what newtypes are for! The problem does indeed occur in your example: What is (id :: [a] - [b]) supposed to be, Prelude.id (as given by the general instance for functions) or map Prelude.id (given by your instance)? -- Steffen ---End Message--- ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Invitation to connect on LinkedIn
LinkedIn Chatura Roche requested to add you as a connection on LinkedIn: -- Steve, I'd like to add you to my professional network on LinkedIn. - Chatura Accept invitation from Chatura Roche http://www.linkedin.com/e/-j6322o-hfici7ky-5i/v4h1gXJ8v-XpaSE4KRp1AY1vvMqM3M3_nx3cS2/blk/I599973465_15/3wOtCVFbmdxnSVFbm8JrnpKqlZJrmZzbmNJpjRQnOpBtn9QfmhBt71BoSd1p65Lr6lOfPkNnPkSd3cTejAVdkALhSBvqntncBgLdPcMdjwMe3kQcz4LrCBxbOYWrSlI/eml-comm_invm-b-in_ac-inv28/?hs=falsetok=3J7B821HsFolI1 View profile of Chatura Roche http://www.linkedin.com/e/-j6322o-hfici7ky-5i/rso/115844279/bO7F/name/2590796_I599973465_15/?hs=falsetok=2rBn8vy6QFolI1 -- You are receiving Invitation emails. This email was intended for Steve Severance. Learn why this is included: http://www.linkedin.com/e/-j6322o-hfici7ky-5i/plh/http%3A%2F%2Fhelp%2Elinkedin%2Ecom%2Fapp%2Fanswers%2Fdetail%2Fa_id%2F4788/-GXI/?hs=falsetok=2uNFpw0kwFolI1 (c) 2012, LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] package-inplace is shadowed by package package-hexstring
Hi, I just got the same thing with attoparsec GIT: Preprocessing benchmark 'benchmarks' for attoparsec-0.10.4.0... Building benchmark benchmarks... creating dist/build/benchmarks creating dist/build/benchmarks/benchmarks-tmp /home/niklas/opt/haskell-7.4/bin/ghc --make -fbuilding-cabal-package -O -odir dist/build/benchmarks/benchmarks-tmp -hidir dist/build/benchmarks/benchmarks-tmp -stubdir dist/build/benchmarks/benchmarks-tmp -i -idist/build/benchmarks/benchmarks-tmp -ibenchmarks -idist/build/autogen -Idist/build/autogen -Idist/build/benchmarks/benchmarks-tmp -optP-include -optPdist/build/autogen/cabal_macros.h -hide-all-packages -package-conf dist/package.conf.inplace -package-id base-4.5.1.0-66f22db3dfcd87541c9c7e50e7095d26 -package-id bytestring-0.9.2.1-503e91bb155301fdb1956cb5c26ce6e9 -package-id criterion-0.6.2.1-5bc7e5a96c8208948366b8e3ea536e68 -package-id deepseq-1.3.0.0-c26e15897417ecd448742528253d68f6 -package-id parsec-3.1.3-771f99c8818551756b6f2ec3e86ab039 -package-id text-0.11.2.3-db61832d0c4660614c4ceff234ed4abb -package-id attoparsec-0.10.4.0-inplace -XHaskell98 benchmarks/Benchmarks.hs -o dist/build/benchmarks/benchmarks command line: cannot satisfy -package-id attoparsec-0.10.4.0-inplace: attoparsec-0.10.4.0-inplace is shadowed by package attoparsec-0.10.4.0-c391286d724823eaea3d4278acc0acc0 (use -v for more information) I have no clue what's going on! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] multivariate normal distribution in Haskell?
Is [1] what you're looking for (see the 'multinormal' function)? monte-carlo's pretty great... :) - Clark [1] http://hackage.haskell.org/packages/archive/monte-carlo/0.4.2/doc/html/Control-Monad-MC-Class.html#t:RNG On Sat, Apr 13, 2013 at 9:26 AM, Bas de Haas w.b.deh...@uu.nl wrote: Dear List, I’m implementing a probabilistic model for recognising musical chords in Haskell. This model relies on a multivariate normal distribution. I’ve been searching the internet and mainly hackage for a Haskell library to do this for me, but so far I’ve been unsuccessful. What I’m looking for is a Haskell function that does exactly what the mvnpdf function in matlab does: http://www.mathworks.nl/help/** stats/multivariate-normal-**distribution.htmlhttp://www.mathworks.nl/help/stats/multivariate-normal-distribution.html Does anyone know a library that can help me out? Thanks. Kind regards, Bas de Haas -- dr. W. Bas de Haas Department of Information and Computing Sciences Utrecht University E: w.b.deh...@uu.nl T: +31 30 253 5965 I: http://www.uu.nl/staff/**WBdeHaas/ http://www.uu.nl/staff/WBdeHaas/ __**_ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/**mailman/listinfo/haskell-cafehttp://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] Unbound: rebind and unrebind
I am working at reimplementing the library Unbound to understand how it works. One issue I have come up with is that an equation that I thought held true doesn't. The equation is: Forall e::Rebind a b, e `aeq` (uncurry rebind . unrebind $ e) = True. That is that spliting the binding of a rebind and then adding it back should be the identity. The issue is that Rebind does not freshen its pattern variables on unrebind, because it assumes that a higher level unbind already did that if required. But I believe this is not sufficient as there is not necesarily a higher level Bind to be ubound as shown by this program: {-# LANGUAGE TemplateHaskell, UndecidableInstances, FlexibleInstances, MultiParamTypeClasses #-} module Main where import Unbound.LocallyNameless data Exp = Var (Name Exp) deriving Show $(derive [''Exp]) instance Alpha Exp instance Subst Exp Exp where isvar (Var x) = Just (SubstName x) x :: Name Exp x = string2Name x y :: Name Exp y = string2Name y rebindPass :: Alpha a = Rebind Exp a - Rebind Exp a rebindPass = (uncurry rebind . unrebind) main :: IO () main = do let rebound = (rebind (Var y) (Embed (Var x))) print $ rebound let substed = subst x (Var y) rebound print $ substed print $ unrebind substed print $ rebindPass substed Which outputs: Var y {Var x} Var y {Var y} (Var y,{Var y}) Var y {Var 0@0} If the equation holds true then the second and fourth lines should be identical but they are not. Can someone explain why this is the correct behavior or if the implementation is incorrect? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] multivariate normal distribution in Haskell?
Bas de Haas w.b.deh...@uu.nl writes: Dear List, I’m implementing a probabilistic model for recognising musical chords in Haskell. This model relies on a multivariate normal distribution. I’ve been searching the internet and mainly hackage for a Haskell library to do this for me, but so far I’ve been unsuccessful. What I’m looking for is a Haskell function that does exactly what the mvnpdf function in matlab does: http://www.mathworks.nl/help/stats/multivariate-normal-distribution.html Does anyone know a library that can help me out? As you are likely aware, the trouble with the multivariate normal is the required inversion of the covariance. If you make assumptions concerning the nature of the covariance (e.g. force it to be diagonal or low dimensional) the problem gets much easier. To treat the general, high dimensional case, you pretty much need a linear algebra library (e.g. HMatrix) to perform the inversion (and determinant for proper normalization). Otherwise, implementing the function given the inverse is quite straightforward. Cheers, - Ben ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Building the Haskell Platform in Linux
On 13-04-13 12:19 AM, Daniel Díaz Casanueva wrote: Hi cafe! Probably you all know how to do this, but I myself found confused when building the Haskell Platform in Linux for my first time. I was using Linux for my first time too! The first problem I encountered was to decide what linux packages install to make the ./configure successful in both GHC binary distribution and the Haskell Platform. So I collected the names of the minimum set of packages that you need to have installed before starting with GHC and the Platform in a small blog post: http://deltadiaz.blogspot.com/2013/04/haskell-platform-from-source-in-linux.html Shameless plug: also my http://www.vex.net/~trebla/haskell/haskell-platform.xhtml and it will be yet updated again next version. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Building the Haskell Platform in Linux
Hello Albert! Oh! I didn't find that one when searching for info! That would have helped me a lot! By the way, a random question, what's the memory of the computer you used to build the Platform? On Sun, Apr 14, 2013 at 6:54 PM, Albert Y. C. Lai tre...@vex.net wrote: On 13-04-13 12:19 AM, Daniel Díaz Casanueva wrote: Hi cafe! Probably you all know how to do this, but I myself found confused when building the Haskell Platform in Linux for my first time. I was using Linux for my first time too! The first problem I encountered was to decide what linux packages install to make the ./configure successful in both GHC binary distribution and the Haskell Platform. So I collected the names of the minimum set of packages that you need to have installed before starting with GHC and the Platform in a small blog post: http://deltadiaz.blogspot.com/**2013/04/haskell-platform-from-** source-in-linux.htmlhttp://deltadiaz.blogspot.com/2013/04/haskell-platform-from-source-in-linux.html Shameless plug: also my http://www.vex.net/~trebla/**haskell/haskell-platform.xhtmlhttp://www.vex.net/~trebla/haskell/haskell-platform.xhtml and it will be yet updated again next version. __**_ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/**mailman/listinfo/haskell-cafehttp://www.haskell.org/mailman/listinfo/haskell-cafe -- E-mail sent by Daniel Díaz Casanueva let f x = x in x ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] NaN as Integer value
On Sun, Apr 14, 2013 at 3:28 PM, wren ng thornton w...@freegeek.org wrote: Whereas the problematic values due to infinities are overspecified, so no matter which answer you pick it's guaranteed to be the wrong answer half the time. Part of this whole problem comes from the fact that floats *do* decide to give a meaning to 1/0 (namely Infinity). I'm not sure what you mean about overspecification here, but in setting 1/0 as +infinity (as opposed to -infinity), there's an easily overlooked assumption that the limit is obtained from above as opposed to from below. -- Kim-Ee ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] [Announcement] Sparse matrix Conjugate Gradient Solver
I'm happy to announce the first release of conjugateGradient, implementing the Conjugate Gradient algorithm for solving linear systems of equations over sparse matrices: http://hackage.haskell.org/package/conjugateGradient The conjugate gradient algorithm only applies to the cases when the input matrix is symmetric and positive definite. See: http://en.wikipedia.org/wiki/Conjugate_gradient_method The advantage of this method is that it can handle really large sparse systems quite well, when other direct methods (such as LU decomposition) are just not practical due to algorithmic complexity. Such large and sparse systems naturally arise in engineering applications, such as in ASIC placement algorithms and when solving partial differential equations. Bug reports, feedback, and improvements are always welcome. -Levent. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Building the Haskell Platform in Linux
On 13-04-14 08:12 PM, Daniel Díaz Casanueva wrote: By the way, a random question, what's the memory of the computer you used to build the Platform? I have always used my laptop with 3GB RAM. I have not measured how much is actually needed, or what happens if I provide less. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] customizing haskeline?
I tried to colorize a haskeline prompt by putting control characters in it, but line editing was hopelessly confused, presumably because haskeline doesn't understand control characters and thought the prompt was longer than it really was. From looking at Haskeline.promptedInput, it seems like there's no way to set the prompt to a higher level terminal operation since it's hardcoded to String, and there's no way to tell it how many displayed characters the prompt contains. So is there some way to have a fancy prompt that I'm missing? Has anyone done that successfully? This also implies it's impossible for haskeline to cooperate with cursor addressing in general. Or maybe it would be ok as long as I don't do anything fancy on the prompt line. But also seems like you can't set custom keybindings, e.g. bind a control key to a history menu like shells can do, which is my real goal here. I guess I'm interested if anyone has been able to use haskeline for anything more complicated than a prompt with the hardcoded default behaviour. My impression is that it's basically non-extensible, but maybe there's some hook I'm missing. By extension it seems impossible to colorize a ghci prompt, and indeed embedding control characters directly in :set prompty leads to the same problems. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [Announcement] Sparse matrix Conjugate Gradient Solver
Nice! I will look at your implementation to see if I can learn something from this. :) On Sun, Apr 14, 2013 at 9:59 PM, Levent Erkok erk...@gmail.com wrote: I'm happy to announce the first release of conjugateGradient, implementing the Conjugate Gradient algorithm for solving linear systems of equations over sparse matrices: http://hackage.haskell.org/package/conjugateGradient The conjugate gradient algorithm only applies to the cases when the input matrix is symmetric and positive definite. See: http://en.wikipedia.org/wiki/Conjugate_gradient_method The advantage of this method is that it can handle really large sparse systems quite well, when other direct methods (such as LU decomposition) are just not practical due to algorithmic complexity. Such large and sparse systems naturally arise in engineering applications, such as in ASIC placement algorithms and when solving partial differential equations. Bug reports, feedback, and improvements are always welcome. -Levent. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- E-mail sent by Daniel Díaz Casanueva let f x = x in x ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] yi-editor for emacer
Hi Cafe, I'm glad to announce my fork of yi-editor. As a emacer, I made yi-editor more emacs like, including the following change: 1. ido-mode like file find and buffer find 2. support more color in vty 3. automatic search tags file in parents's directory 4. change some keymap The following step to have a try: 1. clone : git clone https://github.com/onlyu/yi.git 2. build : ./yi/yi.sh --rebuild 3. run: ./yi/yi.sh Thanks for have a test, and thanks yi-editor, now I combine my favourite editor (emacs) and language (haskell) together. Apologize for my noisy! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe