Countall
  Home FAQ Contact Sign in
 
Advanced search
MATCHING GROUPS



more...
POPULAR GROUPS

more...

found 18 articles for 0.303 sec
Mark T.B. Carroll wrote: > ssecorp <circularfunc@gmail.com> writes: > >> classify good bad test = >> (countall bad test) / ((countall bad test) + (countall good test)) >> >> here I do (countall bad test) twice. will this somehow be done only >> once though because the compiler is smart enough to figure that out? > > With GHC often it won't. I know it does some, and I don't know about     

Group: comp.lang.haskell · Group Profile · Search for Countall in comp.lang.haskell
Author: Simon Richard Clarkstone
Date: Jul 20, 2008 06:16

Mark T.B. Carroll <Mark.Carroll@aetion.com> wrote: ssecorp <circularfunc@gmail.com> writes: classify good bad test = (countall bad test) / ((countall bad test) + (countall good test)) here I do (countall bad test) twice. will this somehow be done only once though because the compiler is smart enough to figure that out? With GHC often it won't. I know it does some
Show full article (1.61Kb) · Show article thread
ssecorp <circularfunc@gmail.com> wrote: > occ x (a:ab) count > | x == a && ab /= [] = occ x (ab) (count + 1) > | x /= a && ab /= [] = occ x (ab) count > | x == a && ab == [] = count + 1 > | otherwise = count > occur x (a:ab) = occ x (a:ab) 0 > counter (s:set) (list) tuple > | (set) /= [] = counter set (list) (tuple ++ [(s, occur s (list))]) >     

Group: comp.lang.haskell · Group Profile · Search for Countall in comp.lang.haskell
Author: Dirk Thierbach
Date: Jul 18, 2008 03:05

Below is a simple spamfilter I have written in Haskell. It is very slow but effective and trainable. I will make a better version tomorrow, right now I do a lot of going over lists many times and probably have some exponential functions in there. I will also choose better names for the functions and add type declarations. However it works and does a good job after just a few emails. It is
Show full article (0.78Kb) · Show article thread
ssecorp <circularfunc@gmail.com> writes: > classify good bad test = > (countall bad test) / ((countall bad test) + (countall good test)) > > here I do (countall bad test) twice. will this somehow be done only > once though because the compiler is smart enough to figure that out? With GHC often it won't. I know it does some, and I don't know about this case, but sometimes with lazy evaluation     

Group: comp.lang.haskell · Group Profile · Search for Countall in comp.lang.haskell
Author: Dirk Thierbach
Date: Jul 18, 2008 02:02

"Mark T.B. Carroll" <Mark.Carroll@Aetion.com> writes: counter (s:set) (list) tuple | (set) /= [] = counter set (list) (tuple ++ [(s, occur s (list))]) | (set) == [] = (tuple ++ [(s, occur s (list))]) countall (s:set) (list) = counter (s:set) (list) [] You mostly don't need the parentheses where you don't have a `:'. Also, `null' is a more typical`==[]' test
Show full article (4.43Kb) · Show article thread
ssecorp <circularfunc@gmail.com> writes: > aha! There's nothing like posting publicly to make you suddenly realise. (-: > occ x (a:ab) count > | x == a && ab /= [] = occ x (ab) (count + 1) > | x /= a && ab /= [] = occ x (ab) count > | x == a && ab == [] = count + 1 > | otherwise = count > occur x (a:ab) = occ x (a:ab) 0 That seems very unidiomatic     

Group: comp.lang.haskell · Group Profile · Search for Countall in comp.lang.haskell
Author: ssecorp
Date: Jul 17, 2008 20:53

aha! occ x (a:ab) count | x == a && ab /= [] = occ x (ab) (count + 1) | x /= a && ab /= [] = occ x (ab) count | x == a && ab == [] = count + 1 | otherwise = count occur x (a:ab) = occ x (a:ab) 0 counter (s:set) (list) tuple | (set) /= [] = counter set (list) (tuple ++ [(s, occur s (list))]) | (set) == [] = (tuple ++ [(s, occur s (list
Show full article (1.99Kb)
occ x (a:ab) count | x == a && ab /= [] = occ x (ab) (count + 1) | x /= a && ab /= [] = occ x (ab) count | x == a && ab == [] = count + 1 | otherwise = count occur x (a:ab) = occ x (a:ab) 0 counter (s:set) (l:list) tuple | (set) /= [] = counter set (l:list) (tuple ++ [(s, occur s (l:list))]) | otherwise = tuple countAll (s:set) (l:list)     

Group: comp.lang.haskell · Group Profile · Search for Countall in comp.lang.haskell
Author: Mark T.B. Carroll
Date: Jul 17, 2008 19:34

Show full article (0.52Kb) · Show article thread
    

Group: comp.lang.haskell · Group Profile · Search for Countall in comp.lang.haskell
Author: ssecorp
Date: Jul 17, 2008 18:53

Show full article (0.23Kb)
    

Group: comp.lang.haskell · Group Profile · Search for Countall in comp.lang.haskell
Author: Mark T.B. Carroll
Date: Jul 17, 2008 17:03

Show full article (0.74Kb) · Show article thread
    

Group: comp.lang.haskell · Group Profile · Search for Countall in comp.lang.haskell
Author: Mark T.B. Carroll
Date: Jul 17, 2008 16:55

Show full article (1.26Kb) · Show article thread
    

Group: comp.lang.haskell · Group Profile · Search for Countall in comp.lang.haskell
Author: ssecorp
Date: Jul 17, 2008 16:33

Show full article (0.45Kb) · Show article thread
    

Group: comp.lang.haskell · Group Profile · Search for Countall in comp.lang.haskell
Author: ssecorp
Date: Jul 17, 2008 16:26

Show full article (0.55Kb) · Show article thread
1 · 2 · next