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
distortion park
Apr 25, 2011


AlsoD posted:

common haskell naming conventions:
a ' after a haskell function means it's a strict version
a M afterwards means it's a side-effecting (monadic) version and returns the results too
a M_ afterwards means that it does side effects but throws away the results

see: map, map', mapM, mapM_, mapM'_

thanks i had got the ' confused with Julia i think, where it does denote (side) effects on the arguments

Adbot
ADBOT LOVES YOU

MononcQc
May 29, 2007

Valeyard posted:

Erlang

(sorry Mono)

eh?

gonadic io
Feb 16, 2011

>>=

pointsofdata posted:

thanks i had got the ' confused with Julia i think, where it does denote (side) effects on the arguments

even worse is matlab where ' is a post-fix function which transposes a matrix used like: X'*A*X

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

AlsoD posted:

people (you and shaggar) keep citing this triumphantly, have you watched the rest of the video (from 3-4 years ago) where he gives a little more context on that statement?

they know

Valeyard
Mar 30, 2012


Grimey Drawer

AlsoD posted:

even worse is matlab where ' is a post-fix function which transposes a matrix used like: X'*A*X

well that one actually makes sense

distortion park
Apr 25, 2011


pointsofdata posted:

thanks i had got the ' confused with Julia i think, where it does denote (side) effects on the arguments

this is terrible misinformation it should be !

Workaday Wizard
Oct 23, 2009

by Pragmatica
i always thought ' denoted helper functions e.g.:
func_with_accumulator n = func_with_accumulator' n acc:0

gonadic io
Feb 16, 2011

>>=

Shinku ABOOKEN posted:

i always thought ' denoted helper functions e.g.:
func_with_accumulator n = func_with_accumulator' n acc:0

this is what i was originally taught but i've not see it used much in the wild, people often just call these functions 'go' (see my post a few pages ago).

I suppose it's somewhat context dependant - if it's defined local to the function in a where block then it wouldn't make much sense for it to be a strict version while its bad practice to make little helper functions like this be top-level in the module

Bloody
Mar 3, 2013

i am a sane person so i do not put 's in my function names.

gonadic io
Feb 16, 2011

>>=

Bloody posted:

i am a sane person so i do not put 's in my function names.

next you'll be telling me that you don't use x₀ and x₁ :v:

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

AlsoD posted:

next you'll be telling me that you don't use x₀ and x₁ :v:

are there programming languages where you can use wacky non-ascii characters in function names?

gonadic io
Feb 16, 2011

>>=

prefect posted:

are there programming languages where you can use wacky non-ascii characters in function names?

AlsoD posted:

lmao if you thought haskell's operators were bad agda lets you put underscores in the name then call that function with arguments wherever underscores were

i.e.
code:
data Tree (X : Set) : Set where
  leaf     : Tree X
  _<[_]>_  : Tree X -> X -> Tree X -> Tree X

insertTree : Nat -> Tree Nat -> Tree Nat
insertTree n leaf          = leaf <[ n ]> leaf
insertTree n (l <[ x ]> r) = ...

radium wouldn't show it but those <[ are actually BLACK LEFT-POINTING SMALL TRIANGLE

Agda :q:

gonadic io fucked around with this message at 13:02 on May 2, 2014

gonadic io
Feb 16, 2011

>>=
here we go:


it's not just acceptable in agda but common practice and baked into the standard library lmao

gonadic io fucked around with this message at 13:26 on May 2, 2014

more like dICK
Feb 15, 2010

This is inevitable.

prefect posted:

are there programming languages where you can use wacky non-ascii characters in function names?

You need a special keyboard for APL :getin:

Nomnom Cookie
Aug 30, 2009



prefect posted:

are there programming languages where you can use wacky non-ascii characters in function names?

ಠ_ಠ

pre:
public class ಠ_ಠ {
    public static void main(String[] args) {
        System.out.println("ಠ_ಠ");
    }
}
although a close reading of the spec suggests that only characters in the BMP are permitted in java identifiers so no public final void 💩()

Nomnom Cookie
Aug 30, 2009



yeah i just tried it and javac won't let you name a class 💩

Zombywuf
Mar 29, 2008

AlsoD posted:

here we go:


it's not just acceptable in agda but common practice and baked into the standard library lmao

And has it's own input method in the emacs mode :-)

Have you actually managed to write a useful program in Agda yet?

Bloody
Mar 3, 2013

these sorts of features are nice when writing obfuscated c

Shaggar
Apr 26, 2006

AlsoD posted:

people (you and shaggar) keep citing this triumphantly, have you watched the rest of the video (from 3-4 years ago) where he gives a little more context on that statement?

yes that's the one we're talking about. Haskell is useless cause its effects are very limited. But when you move a Haskell feature into c#, then it becomes very useful. So the only reason you should be using Haskell is to develop features for c#.

gonadic io
Feb 16, 2011

>>=

Zombywuf posted:

And has it's own input method in the emacs mode :-)

Have you actually managed to write a useful program in Agda yet?

I'm busy atm but I totally will finish off some sort of binary tree with lower and upper bounds

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
lol at my company's it department pitching dreamhost unironically

$500 million company lol

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

Shinku ABOOKEN posted:

someone mention network stacks on one of these threads

why is bsd network stack a thing (as in why care that it originated in bsd or whatev) and why does windows having its own network stack matter?

i mean how different can stacks be? it's all just bit shuffling with packets using well defined protocols (tcp/ip etc.)


can someone tell me why should i care?

sry if my quuestion is not clear i have a flu

berkeley was first to implement the concept of sockets as we know them today (or at least in their current forms? idr) and bsd became the most popular internet os for a while and a lot of people took networking code and concepts from them.

1993 rolls around, microsoft needs an ip implementation for windows nt, so they license one from a third party which was derived from bsd code. it shipped as another network system alongside ipx et al

i'm sure someone like hackbunny knows exactly how much of that code still remains, iirc the windows license included an attribution to the university of california as late as xp

e: it's literally about the origin of the code, the ip utilities like ping and ftp behave like the bsd versions and accept, possibly uniquely in windows, command line switches with dashes instead of slashes

Quebec Bagnet fucked around with this message at 02:47 on May 3, 2014

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

coffeetable posted:

sulk have you done anything of note in haskell or c# or did you just watch that four minute video of spj and Form An Opinion

do you really need to ask this about sulk

FamDav
Mar 29, 2008

chmods please posted:

do you really need to ask this about sulk

double sulk posted:

Go gently caress yourself

Bloody
Mar 3, 2013

chmods please posted:

berkeley was first to implement the concept of sockets as we know them today (or at least in their current forms? idr) and bsd became the most popular internet os for a while and a lot of people took networking code and concepts from them.

1993 rolls around, microsoft needs an ip implementation for windows nt, so they license one from a third party which was derived from bsd code. it shipped as another network system alongside ipx et al

i'm sure someone like hackbunny knows exactly how much of that code still remains, iirc the windows license included an attribution to the university of california as late as xp

e: it's literally about the origin of the code, the ip utilities like ping and ftp behave like the bsd versions and accept, possibly uniquely in windows, command line switches with dashes instead of slashes

this made me realize that im pretty sure the only command line tools ive ever used on windows are ip utilities because i couldnt think of any that didnt accept dash switches

Forums Terrorist
Dec 8, 2011

i've used a couple of the disk utilities but otherwise same, that's weird

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

double sulk posted:

haskell is a useless language deemed as such by its lead designer and exists solely for the purpose of improving more useful languages like c#

actually the lead designer said it started out useless but isn't anymore. hth

Nomnom Cookie
Aug 30, 2009



he has to say that or microsoft would fire him. hth

power botton
Nov 2, 2011

ah ya the PR machine that is microsoft research

Nomnom Cookie
Aug 30, 2009



they're not gonna pay him to work on something useless dumass. otoh its also not allowed to work on anything anyone cares about

Progressive JPEG
Feb 19, 2003

prefect posted:

are there programming languages where you can use wacky non-ascii characters in function names?

one of the early golang presentation vids has an example of how public/private is handled, where uppercase omega is public and lowercase omega is private

or it may have been some other greek char i dont remember for sure

anyway the vid was from an I/O i think

a cyberpunk goose
May 21, 2007

im a dumb baby and i spend most of my time in imperative languages but using C# and even (gasp) python is nice sometimes because i get to whip out cool functional programming tricks that make some problems really natural to solve instead of writing like 50 lines of nested loops and fragile recursion

:shobon: argument for mediation?

wait this is the pos

lol if you program a computer

Bloody
Mar 3, 2013

just use langs that target the CLR and/or start with the letter c and arent clojure and you will be fine.

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Kevin Mitnick P.E. posted:

he has to say that or microsoft would fire him. hth

even if he would have been fired not for saying that in that video (which isn't true) that clearly wasn't his motivation for saying so

Progressive JPEG
Feb 19, 2003

bad opinions about langs:

i use python for poo poo thats small or temporary or otherwise doesnt need reasonable certainty that it'll always work or handle errors correctly

java at work cuz thats what my team uses
c++11 for my own stuff that doesnt already fall in the python bucket

c# is great but ive successfully avoided windows programming so far and arent in any hurry to start now

nrook
Jun 25, 2009

Just let yourself become a worthless person!

Shaggar posted:

yes that's the one we're talking about. Haskell is useless cause its effects are very limited. But when you move a Haskell feature into c#, then it becomes very useful. So the only reason you should be using Haskell is to develop features for c#.

Or, to understand features in C# better. I don't want to learn Haskell and use it for toy projects because I think it is the best language for the job. I want to learn it because I think it will improve my code in languages which have some support for functional programming, like C# and Python.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Kevin Mitnick P.E. posted:

they're not gonna pay him to work on something useless dumass.
huh, was windows written by volunteers then?

Valeyard
Mar 30, 2012


Grimey Drawer

nrook posted:

Or, to understand features in C# better. I don't want to learn Haskell and use it for toy projects because I think it is the best language for the job. I want to learn it because I think it will improve my code in languages which have some support for functional programming, like C# and Python.

why wouldnt you just use c# and python to get better in them?

nrook
Jun 25, 2009

Just let yourself become a worthless person!
bc idiomatic c# and python don't look like haskell

Adbot
ADBOT LOVES YOU

a cyberpunk goose
May 21, 2007

Valeyard posted:

why wouldnt you just use c# and python to get better in them?

working in a lang that forces you to be functional is going to make you think about problems functionally instead of imperatively which 99.99% of the CS world approaches problems as so im in support of learning a toy lang for the purpose of bending your brain

  • Locked thread