« first day (83 days earlier)      last day (3441 days later) » 
00:00 - 19:0019:00 - 00:00

12:01 AM
How do I go to definition if I have:
let johan = { Name ="Johan" ; Age =36}
 
click on Name, hit F12
that works fine
 
ah ty that was the only thing I did not F12 :)
 
@ReedCopsey erased providers?
 
@Maslow what about them?
 
never heard of the idea
erased providers? erase types? what is it?
 
12:17 AM
erased type providers (which is most of them, really) don't actually create types in the assembly where they're used - the make something that looks like a type, but are "erased" at compile time into other code
a lot of the type providers out there work that way, which is why you can't use the "types" they make (directly) from C#, etc
generative type providers actually create types in the assembly when you use them
 
Is there a reason there is no default overload of ToString for records?
 
not typically used in F#
 
I'm thinking:
type Person =
    { Name : string
      Age : int }
    override x.ToString() = sprintf "{ Name: %s ; Age: %d}" x.Name x.Age
(same as ctor could make sense)
 
@JohanLarsson printf "%A" person would do nearly that by default, so why override?
 
^ that's why, @JohanLarsson - %A formatter gives you something very similar to what you typed already
and when you're using F#, you'd typically use the F# structured string output instead of ToString()
 
12:22 AM
and it'd be less code to override this.ToString() with sprintf "%A" this to get what you want
 
(you do get extra line breaks and ; in there, though)
Anyways - Gotta run - have a good night everybody - hope to see all the new faces around again soon :)
 
@Maslow ah nice ty ty
 
 
6 hours later…
6:29 AM
Here is something that I have been working on to make XML parsing a bit easier:
type MaybeBuilder() =
    member this.Bind(m,f) = Option.bind f m

    member this.Return (m) = Some(m)

let maybe = MaybeBuilder()

let ALong (value: string) =
    int64 value

let As<'T> (parseFunc : string -> 'T) (value: string option)  =
    maybe {
        let! x = value
        return parseFunc(x)
    }
Which then lets me write something like:
xmlFragment.AttributeValue("OUTPUT_ID") |> As ALong
 
When does one not use typeprovider for xml? (noob question)
 
I don't use the TP for xml yet as the TP doesn't work with XSDs. It requires sample xml and I don't always have a complete sample.
Work is in progress on the XSD type provider though. I want to test it out, but I am working to very short deadlines.
 
Nice with TP for XSD. Also nice that you found this chat. Hopefully there will be more activity in euro daytime here from now on.
 
Yeah. I am in South Africa, so our time zones are pretty close.
 
I'm very new to F# so can't do much more than ask dumb questions.
 
6:44 AM
Thats ok. There is no such thing as a dumb question. I have been using F# for a while, but I still feel that I suffer from an intense case of imposter syndrome.
 
imposter syndrome? Writing F# in a C# way?
 
Where it feels like you are pretending you know when you are surrounded by people that know more. (Here is the wiki intro:
The impostor syndrome is a psychological phenomenon in which people are unable to internalize their accomplishments. Despite external evidence of their competence, those with the syndrome remain convinced that they are frauds and do not deserve the success they have achieved. Proof of success is dismissed as luck, timing, or as a result of deceiving others into thinking they are more intelligent and competent than they believe themselves to be.
So @JohanLarsson, are you using F# at work?
 
Nope I use C# but gonna try to switch over to F#as it looks so nice. Fear the get stuck on every line phase though, been procrastinating for too long.
Have you seen dotnetfiddle? Pretty nice.
 
Yeah. I tend to use F# in Visual Studio. There are some really good extensions such as F# Power Tools that make it a pleasure to work with.
Have you read Scott W's blog on Low Risk ways To Introduce F# at Work?
 
nope, do gonna find it.
 
6:55 AM
Hold on, I'll send you a link
 
ty ty
 
Np
 
I think one risk with F# is that it is not so wide spread so finding consultants and hiring new programmers can be an issue. Consultants a bigger issue probably.
I write many small things where I'm free to chose tech so can probably sneak in some F# here and there if I manage to get started.
Do you write F# only at work?
 
7:19 AM
Primarily these days. I write both C# and F#. F# is preferred though
 
I agree with you, @JohanLarsson, I'm now evaluating that risk. But perhaps the problem is not in finding consultants and programmers but the F# community is not so strong than"equivalent" in size programming languages ones.
 
Potential upside can be that the ones who got bored with C# and started with F# are the cream of the crop.
 
7:34 AM
I think these days it is unfortunate that many programmers haven't seen the benifits of functional programming in general (not just F#). I think the F# community is quite strong as a whole, but hasn't reached the adoption of C# yet.
I think that this is partially because microsoft hasn't pushed it the same way Apple pushed Swift.
The advertising machine of Microsoft could bring about a large scale change of ideas if they tried.
 
Morning @Matt
 
hello
 
Yo
 
@AshtonKJ, about the strength, an unfair comparison: a Clojure question with a bounty gets 440 reads, an F# one 88...
 
Fair enough. Do you have a proposed solution? (I am not being antagonistic, I really want the community to grow, and I love to hear other's views on how we can help it. We are the "Early Adopters" still)
 
7:48 AM
Keeping this room active is one way :)
 
In my view the F# community is quite strong. Maybe not as strong as the some of the other FP communities yet, but we are growing. The biggest thing I see as leading to that is that most of the F#'ers I have dealt with have been extremely open to sharing their knowledge and helping the community.
 
Doing projects that succeed.
 
@jruizaranguren, FAKE? :P But I agree. The more successful projects that are out there, the better the language will be viewed by programmers. But programmers are less of a problem than getting business acceptance in my view
 
Or things like fsharpforfunandprofit.com Impressive
 
Agreed. Though I think we need more books out there on F#. Also, I like what Michael Hansen, et al are doing by teaching it at university
 
7:56 AM
I'm not having so much problems in the technical part (spec, features, etc. of the language) such as the "domain model with the language" side of things.
Other languages have a rich set of not trivial examples that are of great aid.
 
FSharp For Fun and Profit helps a lot with that. Also, some of the books (particularly Expert F#) show some good examples. F# For Quantative Finance is also good.
Also with more F# User groups springing up, that is helping. It would have been nice if DotNetConf had included some F# sessions. Or /build/
Currently Twitter and Github seem to have the most active F# communities.
 
8:41 AM
hi @ChristophRüegg
 
ah, hi Johan!
 
8:57 AM
Do you write much F#?
 
Who is that aimed at @JohanLarsson?
 
ChristophRüegg I think :)
 
quite, but would be nice if it would be more ... we could change that a bit by moving the spatial project to F# ;)
 
I'm starting to get my feet wet with F# still.
 
What industries do you guys work in? Financial? other?
 
9:03 AM
We make NC-machines where I work. I'm drawing CAD and programming is more of a hobby. Lately I've been asked to help the programmers out at work though.
 
NC-machines?
 
Numerical control I'm not involved in that one, just a random pic.
 
What does it do?
 
I'm not allowed to tell much about our stuff.
 
Ok. No worries.
 
9:07 AM
Numerical control (NC) is the automation of machine tools that are operated by precisely programmed commands encoded on a storage medium, as opposed to controlled manually via hand wheels or levers, or mechanically automated via cams alone. Most NC today is computer numerical control (CNC), in which computers play an integral part of the control. In modern CNC systems, end-to-end component design is highly automated using computer-aided design (CAD) and computer-aided manufacturing (CAM) programs. The programs produce a computer file that is interpreted to extract the commands needed to operate...
 
It is not very interesting but really fun programming. Nice manageable sized programs with lots of problem solving.
I wrote a parser/interpreter for the NC-language in C#. Would probably be an extremely nice fit for F#.
 
Really awesome to have some activity in this chat during this timezone.
 
btw, the spatial project would be quite a good F# excercise to gain some more experience
 
Yeah, I should also finish some of the C# stuff
Been in lazy mode for a while, first watching world cup then watching pluralsight
 
9:20 AM
of course ...
it's also a good exercise for me, maybe I'll have a go at it myself sometime
 
Applications for public administration. Currently Income Tax calculations module in... F#?
 
Mine are Insurance projects.
 
10:08 AM
Is there a clean way to make this work for the string case? No fan of the explicit <string>
 
10:19 AM
Doesn't seem so. But FsUnit has xUnit support, so you can write it as "1" |> should equal "1"
 
Any good source for diving deep with quotations? I want to analyze if they can help me in solving this stackoverflow.com/questions/24932086/…
 
Reed is my source for everything, he will be here in a couple of hours. Couple ~ 7
 
user1804599
@ReedCopsey does WebSharper do only the F#/HTTP/JS stuff?
 
user1804599
Or is it full-stack crap like Ruby on Rails or Play Framework?
 
10:35 AM
@rightfold what do you mean by full stack crap?
 
user1804599
A ginormous unlearnable library that does HTTP, templates, database, ORM, horses, REST, rats, routing, more database, more HTTP, magic, lots of magic and even more magic.
 
user1804599
Typically comes with a tool that generates your project since it's too complicated to do yourself and not documented.
 
Ahhh. I am not sure. I believe that it does quite a lot of that. I found it too heavy weight for my tastes
I may be wrong. I haven't looked at it for quite a few months
 
user1804599
If it does only HTTP and RPC with JS it should be quite nice. :)
 
But I tend to prefer to do my Html myself (or with some front-end framework like angular).
For F# -> JS I prefer things like FunScript
 
10:48 AM
@JohanLarsson you are right. That <string> is quite ugly
The problem is that .NET strings implement IEnumerable, which confuses it.
 
ah, that explains it, did not think of that
 
11:33 AM
@jruizaranguren there is a chapter in "the book of f#" about quotations - but overall this more of an introductionary book
most likely the best content is inside "Expert F# 3rd edition" - can check both books tomorrow - is there anything specific you look for?
 
11:48 AM
I'm just investigating if it is the path to achieve a couple of features I have seen in a Clojure library.
 
12:04 PM
Is the latest version of F# a nuget download?
 
@JohanLarsson, the preview build?
 
Is 3.1 the preview build? If so yes.
 
3.1.2 is i belive the preview build. 3.1.1 is the current stable as far as i recall
I think 3.1.1 should be available as a visual studio update. 3.1.2 you can grab from here: visualfsharp.codeplex.com
 
ty ty
 
12:19 PM
@jruizaranguren I think you might look at "code quotations" - you get a start here msdn.microsoft.com/en-us/library/dd233212.aspx
 
@AshtonKJ Do you use 3.0?
 
@weismat You might also take a look at FunScript. They have some interesting uses of code quotations.
@JohanLarsson I have just installed 3.1.2. I was using 3.1.1 for quite a while. Not too much changed. A lot of it is bug fixes as far as I remember. Some perf increases too.
Cheers all. Off home now. Will be back when I get there.
 
12:36 PM
@rightfold I'm writing code, not much and def not fast
 
user1804599
Same here.
 
user1804599
It's a slow day.
 
Googling twice per row on average
 
user1804599
Sounds like me trying to use Coq.
 
trying to figure out awaiting a task
Hi @Cat nice to see you!
 
user1804599
12:50 PM
@JohanLarsson can you give an example?
 
using (var client = new WebClient())
{
    var html = await client.DownloadStringTaskAsync(@"http://chat.stackoverflow.com/rooms/51909/f");
    Console.WriteLine(html);
}
@rightfold Like that in C#, I'll google around for a while
 
user1804599
async {
  let! html = client.DownloadStringTaskAsync @"http://chat.stackoverflow.com/rooms/51909/f"
  printfn "%s\n" html
}
 
user1804599
I think it's like this.
 
yeah looks like it, did not love the async { ... } for some reason
 
12:57 PM
@rightfold that looks like async monad
 
user1804599
@BartekBanachewicz guess what.
 
it's an async monad
 
user1804599
do-notation in F# is monad { ... }.
 
user1804599
Me too.
 
12:58 PM
async is akin to MonadAsync
with more syntax diabetes
 
user1804599
What is MonadAsync?
 
user1804599
Because having such a thing would be incredibly silly in Haskell.
 
well I was illustrating the idea
yeah not async but MonadIO, MonadReader and friends
Monad.X.Class
 
user1804599
ok
 
1:11 PM
printfn "%s\n" html
you don't need that \n
printfn is printf with a newline at the end
 
user1804599
But I want two newlines!
 
;)
the code you ported didn't :P
 
user1804599
The client changed his mind.
 
TIL SO has chat rooms
 
@SimonF It can be a bit quiet around here, please stay lurking. Would be great if this room came alive.
 
1:15 PM
I was wondering why there wasn't an active F# room on jabbr
my question here stackoverflow.com/questions/24951474/… languishes without a single answer :P
I'll lurk when I can, sure :)
 
1:39 PM
And I am back
 
 
1 hour later…
2:39 PM
no one is hosting a jabber F# room, that's probably why :)
 
oh I was thinking Jabra
 
Oh.
It seems that the Jabbr.net does get some visits
 
I've never even heard of it
 
I hadn't either
Until a few minutes ago
I don't really use Jabbr much
It has been a while since I have been on any chat. It's kind of nice to be back
 
3:15 PM
Is there anyway to show a notification when people enter this room?
 
You could use JavaScript and watch the members list on the right for changes. :D
 
Not that I know of, there are custom chatbots that can probably do it.
 
urg. That is horrible. Sometimes I miss the good old days of IRC
 
You get a hint from the gravatar row though, they are ordered by time since last activity. When someone enters they are opaque for a couple of minutes.
 
But it's just not the same
:(
 
3:24 PM
I don't know. People did a lot of extremely annoying things with their mIRC scripts. :-)
 
Oh yeah. I remember.
Something about slapping people with trouts, etc
 
Yep
(And I certainly wasn't innocent in that regard. I did spend quite some hours tuning and extending mine....)
 
@AshtonKJ This chat has some nice features though. Like this reply to message. You can follow the arrow and see which message I replied to.
 
Agreed. I just want the best of both worlds.
 
@JohanLarsson That's nice indeed.
 
3:27 PM
To reply to a message you click the arrow to the far right of a message.
 
@AshtonKJ you can have the best of both worlds, you're a developer :)
 
I know right. I am busy examining the html and script to see what I can cook up
 
@AshtonKJ here is code for one of the bots used in chat.
 
user1804599
This chat software lacks permabanning.
 
user1804599
3:29 PM
So it’s horrible when trolls come in.
 
@JohanLarsson Cool. Thanks
 
Not a huge problem ime
 
4:02 PM
Hmm. It appears I have a solution to my question. This might just work.
 
4:27 PM
Yes. Got it. A little bookmarklet that watches the users list for changes.
 
4:51 PM
@jruizaranguren Is there anything specific you're trying to figure out with quotations? I've used them a fair bit in my libs
@rightfold Though you can always (at least temporarily) lock down a room to be moderated
which typically can solve the issue
 
Hi Reed
 
@rightfold Websharper is basically just the F#/HTTP/JS stuff - it's got its own routing engine and a few other things, but you can ignore them easily enough. DB/etc is typically just handled by your F# code, so it's not required to be baked in
Hi @AshtonKJ :) Nice to see you in here!
 
@ReedCopsey Thanks. I didn't even know this place existed. It's nice to see.
 
user1804599
@ReedCopsey awesome.
 
user1804599
Full-stack web libraries make me want to pull out my hair and poke out my eyes.
 
4:57 PM
@rightfold Yeah - I've been really impressed. I wish the licensing was different, but it's not horrible - and so far, everything I've tried has been pretty nice to use
anybody in here done much with PCL and F#?
 
@ReedCopsey PCL as in portable class library?
 
yes
I know it's one of those areas with warts ATM
 
user1804599
> Install WebSharper tooling into your favorite IDE below
 
user1804599
My favourite IDE is not in the list. :<
 
@ReedCopsey not yet. Still trying to get used to xamarin. Finally got a OS/x running in a VM. That was a mission and a half
 
5:00 PM
ouch - that's a tricky one to do
I want to get FSharp.ViewModule working with xamarin forms
and PCL seems like the best approach for that one
but figuring out how to get the profiles correct, etc - and fsharp.core right, seems to be a nightmare and a half
 
Interesting. The FSharp.Core issue seems to crop up over and over.
 
its difficult because its basically "framework", but it's not distributed as part of the framework
so it becomes something you have to manage yourself - which is really a shame
 
Wow, this new bookmarklet makes this chat work much better. I can now easily pick up when users join.
I think I have fixed the one issue I had with SO chats. :P
 
hehehe
 
Close to two rows och chatters idlers :)
 
5:04 PM
@AshtonKJ Source?
 
@ReedCopsey part of me wishes that it was part of .net itself like the other standard libs. It would save me the trouble of making sure that I remembered to include it in my distribution lists
 
@AshtonKJ I'm glad it's not - because I like that it can be distributed OOB, but it does bring some disadvantages
 
@ReedCopsey what browser you on? I have only tested on Chrome (Enable expirmental javascript so that it includes Object.observe)
 
I'm on chrome
 
@ReedCopsey expiremental javascript enabled?
 
5:06 PM
yes
(now)
 
greetings
 
@AshtonKJ Just new user notification, or leave too?
 
Just run it when you join. Then when a user enters you will get a message in the chat list something like: 'User: xxxx joined.'
Currently just joined.
It is easy enough to modify for leave as well
 
morning/evening peeps
 
5:09 PM
Hi @Mathias :)
 
It looks like SO just modifies an object on the window called users.
Hi @Mathias
 
ran it - we'll see :)
@ArtScott Did you see my message from yesterday? Curious what you think...
 
@ReedCopsey standard dev disclaimer. Works on my machine :P
 
hehehe
can't tell until somebody joins
 
Standard PM response: We're not deploying your machine
 
5:13 PM
I need to go back and try to enjoy my delicious algorithmic steak with a spoon... see you guys later!
 
I'll leave and rejoin easy
 
@Mathias Good luck with the C# ;)
 
@Mathias nom nom. C# doesn't make me happy anymore.
I can't remember who wrote that nice post about F# as their mistress. It was funny, but true
 
without creating a temp variable or adding more parenthesis can I do "foo" + some expression that results in a string somehow?
 
@Maslow what do you mean by adding more parenthesis? It would need them to figure out the order of operations I think
Hmmm, the bookmarklet doesn't seem to pick up when users rejoin. It will need some debugging methinks.
 
5:17 PM
well this works, and I suppose this usage of parens to get it done is ok: `let query = if x.Query.IsSome then
x.Query.Value
|> Seq.map (fun (k,v) -> sprintf "%s=%s" k v)
|> String.concat "&"
|> (+) "?"`
 
@Maslow depends on the context - but you often need parens
@AshtonKJ Yeah - I'm not seeing it
 
well, I should say that compiles, don't know if it works yet
it's building a query string for a url
if there are keyvalue pairs, then builds up the string starting with ?
 
why not:
`match x.Query with
 | Some(value) -> value
   |> Seq.map (fun (k,v) -> sprintf "%s=%s" k v)
   |> String.concat "&"
   |> (+) "?"`
| None -> System.String.Empty`
Excuse the spacing.
 
or:
 
(deleted)
 
5:20 PM
I can't get it right on this chat.
 
let query =
    x.Query |> Option.bind (fun (vals) ->
        vals
        |> Seq.map (fun (k,v) -> k + "=" + v)
        |> String.concat "&"
        |> (+) "?"`
        |> Some)
 
ok maybe my chat isn't autoscrolling...
 
That too. If you want it to still be an option.
 
@AshtonKJ When you pastein multi-line, you can hit the "Fixed font" button on the right...
 
@ReedCopsey I wasn't pasting :P
 
5:21 PM
or typing in multi line too
 
Hehe
 
(instead of using back tick, you can hit that)
 
@ReedCopsey your version would return what type a string option?
 
Ahhh good to know.
 
@Maslow yes
 
5:22 PM
@ReedCopsey never noticed that option
 
@AshtonKJ Script worked - a bit too well (got 4 lines, but that may be my fault ;) )
 
Anyways. I am going to go back to lurking, as I am off for a while.
 
I'd like to go ahead and make it string though, I really like some of the things you are demo'ing there, I haven't tried to learn Option.bind though I've seen it once or twice
 
@ReedCopsey yeah. I don't check if there is anything already observing that variable. I need to do some fixes to it.
@Maslow these days I would also look at computation expressions, so my Option.bind has nice syntactic sugar. I use a Maybe type.
Ok, now I really am heading out for a while.
Chat laters.
 
@AshtonKJ does it work sorta like this C# version I wrote shows? int? CityId= employee.Maybe(e=>e.Person.Address.City); maybe.codeplex.com
@ReedCopsey I still don't see a fixed font option appearing on the right in here, maybe I didn't hit a true multiline in that last code paste
 
5:26 PM
should show up next to "upload.."
@rightfold provide a bug from copy/paste :)
shoudln't be there
 
ok I see it now when I paste real newlines or shift+enter
it seems to me to take super long to compile a very small F# program in Visual studio.. I saw references to not having NGen service running, which I think this machine does not.
 
5:48 PM
Hi @SimonF
 
6:14 PM
Welcome to everybody who just joined :)
 
hi! looks like an excellent place to waste time and avoid work :) loving it
 
@toyvo Welcome! Actually, good timing you chimed in. @rightfold has been looking into Websharper (at my prodding) - you'd probably be better at answering his questions than I :)
 
user1804599
Not yet. :P
 
nice, thanks
 
@rightfold You've at least been asking questions about it :)
 
6:21 PM
i'm currently wrapping my head around a single-threaded Concurrent ML implementation
Vesa Karvonen claimed it's at most one day work
guess I should apply a multiplier when planning.. toyvo = 0.25 * Karvonen or so
anyone played with Hopac or Concurrent ML? or similar things? Clojure core.async? JoCaml?
 
user1804599
Clojure core.async is worthless crap.
 
because? at a glance, looks like they give CSP prims, which is more than F# stdlib gives
 
user1804599
Because it translates a single block of code to a state machine.
 
user1804599
But if you call anything from it, that call will be synchronous.
 
user1804599
And this is horror when you want to call asynchronous functions from asynchronous functions.
 
6:24 PM
yikes, yes
so you can't call out into asynchronous methods from that state machine? I just assumed that. bummer
 
user1804599
I prefer something based on promises as in C# or the language I’m working on.
 
user1804599
I’ve never used F# async so I can’t say anything about that. :P
 
:)
 
user1804599
My favourite way of doing async I/O is not doing async I/O at all and instead having green threads and a VM or runtime that makes everything work, as with Erlang and Go.
 
user1804599
But that doesn’t work well in existing environments. :(
 
6:26 PM
doesn't work, as in - bad memory use or throughput?
i work a lot with "green" threads in JS, translated from F# async
for "toy" examples we have it mostly works
 
user1804599
You either have to spawn an OS thread, which is memory-hungry, or you have to give up interoperability with the target platform, or you have to let the programmer deal with explicit async/await.
 
but it gives very little in way of synchronization. hence my latest obsession with more powerful synchronization constructs like CML cml.cs.uchicago.edu/pages/cml.html
right
so i'm in the camp #3 - explicit typing layer, Async<'T>
annoying but works..
 
user1804599
Or you have to resort to ugly hacks like Quasar which modify bytecode at runtime to implement green threads even with existing I/O code. :D
 
right, why hacks though? :) at least in principle, the program transformation approach could work correctly..
would be easier if the language didn't have abominations like reflection, etc..
so for CML, there's this nice F# library github.com/VesaKarvonen/Hopac that provdes CML-like combinators. it's very cool. But compared to original CML, as you point out, there's the needed extra level of type indirection
(unit -> 'T) becomes (unit -> Job<'T>) to signal it can block, etc..
 
@toyvo have you had a chance to actually use/experiment with Hopac? Looks interesting, made its way to my long backlog of things I should try out ;)
 
6:34 PM
a little bit here and there. i'm implementing it now for WebSharper
it seems essential for projects with a lot of concurrency
UI, servers
basically whenever you use a complex F# MailboxProcessor, Hopac could probably help you do better, break the code into easier to understand pieces
 
working on a toy project right now that fits this to a T...
 
check it out then :)
 
yes, sounds like it!
 
what's funny/sad is how old the books and papers are. 1980-s stuff, way more advanced mechanisms for concurrency than "modern" platforms and even newly created languages give
 
user1804599
I blame the web™.
 
user1804599
6:45 PM
And the smartphone™.
 
right-o :)
 
00:00 - 19:0019:00 - 00:00

« first day (83 days earlier)      last day (3441 days later) »