Haskell-Cafe@haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>>
>
>
>
> --
> Work is punishment for failing to procrastinate effectively.
>
> ___
> Haskell-C
ce Tuple (Tuple1 a)
instance NTuple (Tuple1 a)
where
type THead (Tuple1 a) = a
type TTail (Tuple1 a) = ()
thead (Tuple1 a) = a
ttail (Tuple1 a) = ()
tcons a b = Tuple1 a
instance Tuple (a, b)
instance NTuple (a, b)
where
type THead (a, b) = a
type TTail (a, b) = Tuple
id
-- default instances:
instance Functor m
where
fmap f a = a >>= (return . f)
newtype Reader a b = Reader { runReader :: a -> b }
-- instace declaration:
instance Monad (Reader r)
where
return = Reader . const
m >>= f = Reader $ \r -> runReader (f (runReader m r)) r
deriving (Functor)
So syntax changes are very minor.
--
Victor Nazarov
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
tion in
unordered-containers package.
Also I think that value of hash functions is obviously a Monoid and it
will be convenient to have Monoid instance
newtype Hash = Hash Int
instance Monoid Hash where
mempty = Hash 0
Hash a `mappend` Hash b = Hash (a `combine` b)
c
On Wed, Oct 27, 2010 at 7:46 PM, Martijn Schrage wrote:
> On 27-10-10 16:20, Victor Nazarov wrote:
>>
>> Very cool. I'll incorporate your changes, If you don't mind.
>
> Not at all.
>>
>> However, I have some minor remarks.
>> You shouldn
;> main = simpleHTTP nullConf (fileServe [] "./")
>
>
I wasn't able to run it in Chrome without dedicated HTTP-server, seems
like it is the only way...
--
Victor Nazarov
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Wed, Oct 27, 2010 at 4:30 PM, Martijn Schrage wrote:
> On 21-10-10 01:01, Victor Nazarov wrote:
>>
>> I've been working on this for some month and I think now I'm ready to
>> share the results.
>
> Great stuff! I've been looking for something
On Thu, Oct 21, 2010 at 6:35 AM, Richard O'Keefe wrote:
>
> On 21/10/2010, at 12:01 PM, Victor Nazarov wrote:
>
>> I've been working on this for some month and I think now I'm ready to
>> share the results.
>
> Given that this is alpha code, what
el free to experiment with it as you wish.
Implementation
--
Compiler is implemented as [GHC](http://www.haskell.org/ghc/) backend
using GHC API. And been tested with GHC 6.12.1.
--
Victor Nazarov
___
Haskell-Cafe mailing list
Haskell-Cafe@haskel
Control.Arrow:
>>
>> blowup = uncurry (++) . (blowup . allButLast &&& lastToTheLength)
>
> Or you can write it as (liftA2 (,)) as I noted a few lines further in my mail
> ;)
>
> Dominique
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
--
Victor Nazarov
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
f a b
| a > 0 = FisrtConstructor a
| otherwise = SecondConstructor g
where g = h b
h = id
main =
do putStrLn hello
putStrLn . concat
[ hello
, show (f 25 1)
]
flip mapM_ [1..100] $ \n ->
do print n
putStrLn hello
where he
> - Export to gnuplot diagrams (currently bar charts and box plots)
> - Multilingual (english, german)
>
> Here [1] is some documentation about how to build lhae and how to use the
> formula language.
>
I was thinking about writing my own. What I wanted was adding lists
and fun
Bijection a b where
> ...
>
> I agree, the fact that this doesn't work is really dumb.
>
I think it is more simple like:
class Bijection a b where
...
type LeftToRight a = (Bijection a b) => b
type RightToLeft b = (Bijection a b) => a
--
Victor Nazarov
___
y logic defines some basic combinators
> data CombinatorObjF a = CK | CS
> type Cominator = Mu (ApplicativeF :<*> CombinatorObjF)
> instance Show (CombinatorObjF a)
> where showsPrec d CK = showString "K"
> showsPrec d CS = showString "S"
> test3 = s `app` k `app` k `app` (k `app` s)
> where s = Mu . S . Flip . Obj $ CS
> k = Mu . S . Flip . Obj $ CK
> app a b = Mu . S . Flip $ App a b
--
Victor Nazarov
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Mon, Jun 28, 2010 at 12:33 AM, Daniel Fischer
wrote:
> On Sunday 27 June 2010 21:52:18, Victor Nazarov wrote:
>> I've allways found code like
>>
>> > -- maxBound (undefined :: Int)
>>
>> a bit strange
>
> Well, that would indeed be a bit strange
Sizeof' is a type function, and may not be injective
In the first argument of `print', namely
`(sizeof :: Sizeof Word16)'
In the expression: print (sizeof :: Sizeof Word16)
In the expression: do { print (sizeof :: Sizeof Word16) }
What can I do with this code to mak
On Fri, Feb 5, 2010 at 9:54 PM, Mario Blažević wrote:
> Victor Nazarov wrote:
>>
>> Hello,
>>
>> I've been writing some GUI application with Gtk2hs. It's an
>> interpreter for lambda-calculus and combinatory logic, it's GPL and if
>> you int
On Wed, Feb 3, 2010 at 4:11 PM, Heinrich Apfelmus
wrote:
> Victor Nazarov wrote:
>> data Behaviour a =
>> forall b. BBind (Behaviour b) (b -> Behaviour a)
>> | BIO (IO a)
>> | forall obj. GObjectClass obj => BWaitEvent (Event obj) (Behaviour a)
>>
(onClicked button)
buttonB (label ++ "*")
runBehaviour (buttonB "*")
set window [containerChild := button]
widgetShowAll window
mainGUI
--
Victor Nazarov
{-# LANGUAGE ExistentialQuantification #-}
module Main where
import Data.IORef
import S
a where
> type Difference a
> diff :: a -> a -> Difference a
> patch :: a -> Difference a -> a
>
> prop_diffpatch a b = patch a (diff a b) == b
?
If not, where can I start towards the implementation? What's the way
to do it more functionally?
--
Victor Nazar
On Tue, Sep 22, 2009 at 1:31 AM, Daniel Fischer
wrote:
> Am Montag 21 September 2009 23:15:48 schrieb Victor Nazarov:
>> I've tried to reimplement code presented in the following blog post:
>> http://cdsmith.wordpress.com/2009/09/20/side-computations-via-type-classes/
>
xs
addRows q m n (ListMatrix xs) = ListMatrix $ modifyNth n
(zipWith comb (xs !! m))
where comb a b = q * a + b
addCols q m n (LisMatrix xs) = ListMatrix $ map (\row ->
modifyNth n (comb (row !! m)) row)
where comb a b = q * a + b
...
How can I fix this?
On Mon, Aug 3, 2009 at 4:32 PM, Victor Nazarov wrote:
> I've been trying to write some simple web application in haskell using
> FastCGI, HDBC and HStringTemplate. I've got stuck with the following
> problem.
>
[snip]
>
> main :: IO ()
> -- main = runFastCGIConcurren
main :: IO ()
-- main = runFastCGIConcurrent' forkIO 10 (handleErrors test) -- This
allways gives internal error without a chance to find out what happens
main = runFastCGI $ handleErrors test -- This works fine
So one variant of main function works, the other allways gives no
output.
k-0.10.1, stm-2.1.1.2, svgcairo-0.10.1, syb-0.1.0.1,
template-haskell-2.3.0.1, time-1.1.4, unix-2.3.2.0,
utf8-string-0.3.5, xhtml-3000.2.0.1, zlib-0.5.2.0
/home/vir/.ghc/i386-linux-6.10.4/package.conf:
Cabal-1.6.0.1, Cabal-1.6.0.3, binary-0.5.0.1, utf8-string-0.3.5
--
Victor Naza
> counter-example as yet. If somebody here can provide either a proof or a
> counter-example, that would be helpful.
>
It seems obvious scince beta reduction never introduces new variales...
--
Victor Nazarov
___
Haskell-Cafe mailing list
Has
typing...
This solution is not the Haskell way and should be avoid.
--
Victor Nazarov
> On Wed, May 6, 2009 at 11:41 AM, Nico Rolle wrote:
> > super nice.
> > best solution for me so far.
> > big thanks.
> > regards
> >
> > 2009/5/6 Victor Nazarov :
>
x (unfold_parameters parameters)
>
Why not:
lam1 = \[x, y] -> x > y
lam2 = \[x, y, z, a] -> (x > y) && (z < a)
doLam :: Ord a => ([a] -> Bool) -> [a] -> Bool
doLam lam params = lam params
So, this will work fine:
doLam lam1 [1, 2]
doLam lam2 [1,2,3,4]
--
V
t the whole hierarchy is managed by single tool cabal. Drawback is
that you should add /var/lib/cabal/bin into your PATH.
--
Victor Nazarov
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
History a -> History a
goTo (HP n) = foldr1 (.) (replicate n forward) . start
I wonder is there more effective, more easy to implement data structure to
represent History and HistPoint
--
Victor Nazarov
___
Haskell-Cafe mailing list
Haskell-Cafe@haskel
I wonder what software licence I can use to release my application.
I've developed some education tool with the following dependencies:
% ghci Main.hs
GHCi, version 6.10.1: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking .
Hello, cafe.
I whant to switch to GHC 6.10
My application compiled fine with 6.8.3, but after switchin to 6.10,
I've got errors about usage of catch function:
Main.hs:165:14:
Ambiguous type variable `e2' in the constraint:
`Exception e2' arising from a use of `catch' at Main.hs:165:14-
On Feb 10, 2008 3:40 PM, Mattes Simeon <[EMAIL PROTECTED]> wrote:
> Thanks for your help. It was very useful.
>
> Though in comparison with C or C++ I can't figure out so clear the syntax.
> Maybe it has to do with the syntactic Sugar of each Language. I 'll give you a
> similar example I saw in a
On Jan 27, 2008 11:49 AM, Bulat Ziganshin <[EMAIL PROTECTED]> wrote:
> oh, yes, they are really still study 19th century physics, but not
> because of great mind, but due to age of university professors. i've
> studied at Moscow University in 89-91 and department of computer
> languages still studi
On Jan 10, 2008 8:39 PM, apfelmus <[EMAIL PROTECTED]> wrote:
> Victor Nazarov wrote:
> >
> Yes, there is: you can use a zipper
>
>http://en.wikibooks.org/wiki/Haskell/Zippers
>
> Here's how:
>
>data Branch v = AppL (Term v)
>
On Jan 11, 2008 2:28 AM, Felipe Lessa <[EMAIL PROTECTED]> wrote:
> On Jan 10, 2008 9:20 PM, Luke Palmer <[EMAIL PROTECTED]> wrote:
> > Ahh, it was ghc 6.8.1, without any optimization. If I turn on optimization,
> > the behavior goes away, and they both behave like the const version.
>
> That was w
On Jan 11, 2008 2:11 AM, Felipe Lessa <[EMAIL PROTECTED]> wrote:
> On Jan 10, 2008 8:54 PM, Luke Palmer <[EMAIL PROTECTED]> wrote:
> > Can someone explain what the heck is going on here?
>
> AFAICT, nothing is wrong. You see, both returned the very same values.
[snip]
> But referential transparency
Hello,
I have little practice in Haskell. And I look forward for suggestions on how
to improve the code. Code is not working: some definitions are missed.
The goal of the code is to implement the evaluator for untyped lambda-calculus.
The main problem is how to display each step of reduction? More
On Dec 7, 2007 4:46 PM, Luke Palmer <[EMAIL PROTECTED]> wrote:
> On Dec 7, 2007 6:27 AM, Victor Nazarov <[EMAIL PROTECTED]> wrote:
> >
> > nary 0 x [] = x
> > nary n f (x:xs) | n > 0 = nary (n-1) (f $ read x) xs
>
> Sometimes it helps to write type si
On Dec 7, 2007 2:52 PM, <[EMAIL PROTECTED]> wrote:
>
> In fact, that distinction is possible. The following article
>
> How to write an instance for not-a-function
> http://okmij.org/ftp/Haskell/typecast.html#is-function-type
>
> specifically describes a method of writing an instan
On 10/4/07, Justin Bailey <[EMAIL PROTECTED]> wrote:
> On 10/3/07, Victor Nazarov <[EMAIL PROTECTED]> wrote:
> > But how would you know that evil dictator uses unsafePerformIO???
>
> You don't. unsafePerformIO can't be taken it away (there are legitimate
&
> i am a newbie in haskell.
> i have read about the tool distcc, http://distcc.samba.org/.
> so i was wondering, does something like this already exist for
> haskell?
> would it be possible to implement a similar tool based on ghc for
> haskell or does this not make sense as a haskell program has t
I still can't remember how guards are treated in Haskell. Here is the
code snippet in question:
foo a | a == 1 = 6
foo a | a == 2 = 7
foo a = 8
Would Haskell fall through to the third alternative if a is not equal
to 1 or 2. I know that this can be rewritten more sanely, but I just
consider guard
43 matches
Mail list logo