Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
LOOK I AM A TURTLE
May 22, 2003

"I'm actually a tortoise."
Grimey Drawer
A couple of tips, for future reference:

Snak posted:

code:
if (x `elem` r) then True else False

You can write this as just x `elem` r.

Snak posted:

code:
checkS c r = case c of 
    (Seq cs)       -> if length cs > 1 then (checkS (head cs) r && checkS (Seq (tail cs)) r) else checkS (head cs) r

If I'm not mistaken, this is a much simpler way to do the same thing:

code:
checkS c r = case c of 
    (Seq cs) -> all (\c -> checkS c r) cs
It also has the benefit that it won't fail if cs is somehow empty.

Adbot
ADBOT LOVES YOU

LOOK I AM A TURTLE
May 22, 2003

"I'm actually a tortoise."
Grimey Drawer

Asymmetrikon posted:

I like Idris over Haskell because of some of the historical weirdness it got rid of (switching : and ::, returning Maybe instead of erroring in, i.e., List access functions, the whole Monad/Applicative thing, Int vs. Integer.) I haven't looked too much into GHC 8, though.

Applicative has been a superclass of Monad since GHC 7.10. The duplicate functions like return/pure and (>>)/(*>) are still there though, and I guess they'll probably never go away.

LOOK I AM A TURTLE
May 22, 2003

"I'm actually a tortoise."
Grimey Drawer
If you like functional programming you might enjoy using React with Flux/Redux (persistent change tracking) and RxJS (FRP-ish). If you prefer Angular 2 you can have static types with TypeScript, and you can use RxJS and/or Redux there as well. Keep in mind that there are always a million alternatives to every library though. Webdev still kind of sucks but it's come a long way.

  • Locked thread