Saturday, March 29, 2008

generalized logit

This is what I feel like writing now:

y = a f(x)/(b + c f(x))
y b + y c f(x) = a f(x)
b y = (a - yc) f(x)
x = f^-1(b y / (a - y c))

Learn Haskell in 10 minutes... Finally!


stripHtml.hs:
stripHtml :: String -> String
stripHtml ('<':xs) = eatTag xs
stripHtml (x:xs) = x : stripHtml xs
stripHtml [] = []

eatTag :: String -> String
eatTag ('>':xs) = stripHtml xs
eatTag (x:xs) = eatTag xs
eatTag [] = []
$ ghci
___ ___ _
/ _ \ /\ /\/ __(_)
/ /_\// /_/ / / | | GHC Interactive, version 6.6, for Haskell 98.
/ /_\\/ __ / /___| | http://www.haskell.org/ghc/
\____/\/ /_/\____/|_| Type :? for help.

Loading package base ... linking ... done.
Prelude> :l stripHtml.hs
[1 of 1] Compiling Main ( stripHtml.hs, interpreted )
Ok, modules loaded: Main.
*Main> stripHtml "<b><blink>What's</blink></b><h1> a better</h1> way to d<tt>o this</tt>?"
"What's a better way to do this?"
This looks like fun.

No comments: