|
Shaggar posted:What i want wrt powershell is linq syntax. something like (dir).OrderByDescending(i=>i.LastWriteTime).Take(5).Sum(i=>i.length) This is also a big complaint I have about Go. No map/reduce or filtering. also, lmao that av
|
# ? Sep 5, 2018 21:55 |
|
|
# ? Dec 3, 2024 15:45 |
|
the Haskell community should rewrite git in Haskell and tell you to interact with the functions from the REPL to use it
|
# ? Sep 5, 2018 21:55 |
|
eschaton posted:the Haskell community should rewrite git in Haskell darcs, you mean
|
# ? Sep 5, 2018 21:59 |
|
While I'm messing around with Haskell, is there any new advice on the best plugin to use for vs code at the moment? I was using haskelly last time I tried haskell, but as always when I went to try it again this time it was broken and this time I ended up giving up after half an hour of trying to get it working and just using the repl. This is possibly my biggest issue with haskell since it somehow happens every single time. If there's a better ide to use instead of vs code I'm open to that too, I guess.
|
# ? Sep 5, 2018 22:07 |
|
Finster Dexter posted:In my mind, it should provide a simple interface to your host environment. REPLs don't really do that? I mean, you could argue that a REPL provides this, but in c#, for example, it takes multiple lines of code to start up a process and I wouldn't want to type System.Process.Start("turd --help") or whatever just to get help with the turd tool. this is kind of how the Dynamic Listener in Symbolics Genera distinguished it there were a ton of commands you could enter (based on the current stack of command tables) and get completion for that provided conveniences for working on the environment but you could also type any Lisp expression and have it evaluated at the same prompt—and indeed supply any Lisp expression as an argument to any command you entered so you could start typing Sho, press space to complete to Show , start typing Dir and press space to get the completion for Show Directory , and then either type a path, type a Lisp expression that evaluates to a path, or click a directory displayed anywhere on the screen, such as in an existing directory listing, or click any other object translatable to a directory object and have that be the argument to the command and of course you could create aliases, create your own commands, use keyboard equivalents, etc. and you could enter options as well and everything was nicely formatted and got live completion prompts with documentation Kalman Reti’s demo is awesome and everyone should watch it to see what could have been, it’s way better than just M-x in GNU emacs
|
# ? Sep 5, 2018 22:08 |
|
mystes posted:OK, I tried turtle. pretend I 1-lined this because it's definitely possible something like code:
|
# ? Sep 5, 2018 22:11 |
|
gonadic io posted:pretend I 1-lined this because it's definitely possible Also, I just realized that I never needed the filenames again anyway so I didn't need to use tuples at all. mystes fucked around with this message at 22:23 on Sep 5, 2018 |
# ? Sep 5, 2018 22:21 |
|
gonadic io posted:pretend I 1-lined this because it's definitely possible code:
|
# ? Sep 5, 2018 22:40 |
mystes posted:Do you know why the following doesn't work? The issue is that you don't want mapM here at all. stat in this case has type Turtle.FilePath -> Shell FileStatus, so you want to just do ls "." >>= stat. Think of Shell as being the List + IO (+ Managed). The list part is relevant here because whenever you use >>= the mapping over shell elements is already implied.
|
|
# ? Sep 5, 2018 23:00 |
|
after reading the docs (which I didn't bother with before) the problem is that ls "." doesn't return a list but a `Shell FilePath`. So there's no need for a mapM and you have ls "." :: Shell FilePath stat :: FilePath -> io FileStatus ls "." >>= stat :: Shell FileStatus the Shell type contains multiple value internally, there's no list. but since you need to get the list asap you might as well just call toList on it immediately (as mysteswas doing anyway) then you do need mapM after all because you have a good old `IO (List Butt)` toList (ls ".") >>= mapM getStat >>= (sum . map (fileSize . snd) . take 5 . sortBy (compare `on` modificationTime)) >>= print
|
# ? Sep 5, 2018 23:02 |
|
what an ergonomic and smooth bash killer
|
# ? Sep 5, 2018 23:14 |
|
beautiful...
|
# ? Sep 5, 2018 23:25 |
|
wait there's a bunch of list functions implemented on a shell so that makes it easier i think the best i can do (i think, i'm just doing these off the top of my head i haven't touched a haskell compiler in months) with the same semantics is code:
p.s. if you use `flip` in haskell you're doing something wrong 100% it is only ever used for stupid golfing like this. perfect for shell scripts! gonadic io fucked around with this message at 00:17 on Sep 6, 2018 |
# ? Sep 5, 2018 23:36 |
gonadic io posted:wait there's a bunch of list functions implemented on a shell so that makes it easier I think you've got a type error there in the fmap FileSize, since the stuff before that is a Shell [FileStatus] not a Shell FileStatus. You gotta either (fmap . fmap) the fileSize or (better yet) combine the Shell [FileStatus] into a Shell Filestatus with fmap select & join. Something like: code:
VikingofRock fucked around with this message at 00:56 on Sep 6, 2018 |
|
# ? Sep 6, 2018 00:53 |
The fmaps get pretty annoying after a while. Maybe they'll add an operator a &| f = fmap f a with the same precedence as &
|
|
# ? Sep 6, 2018 01:31 |
|
comedyblissoption posted:is there something better than git's distributed immutable dag for programming source control committing o nthe blockchain
|
# ? Sep 6, 2018 07:42 |
|
VikingofRock posted:The fmaps get pretty annoying after a while. Maybe they'll add an operator I think that's just the cost of using haskell here - you have to care if your function are 'a -> b' (called with '... & fmap foo & ...' ) or 'a -> Shell b' (called with '... & (>>= foo) & ...') or 'Shell a -> Shell b' ('... & foo & ...')
|
# ? Sep 6, 2018 08:07 |
|
Progressive JPEG posted:committing o nthe blockchain CTO at work was asking about Bitcoin yesterday and so I did some very lovely research and unsurprisingly, the BTC block chain is strictly linear
|
# ? Sep 6, 2018 12:28 |
|
mystes posted:Finding the total size of the most recent 5 files in powershell and turtle (admittedly I suck at haskell so the haskell version is probably not the best solution). for comparison, this is its cousin f# interactive: quote:> open System.IO;; and c# interactive quote:> using System.IO; sure would be nice if we didn't need the boilerplate imports or the double semicolons, and had a few basic aliases like ls and run oh, and didn't need to pay attention to case NihilCredo fucked around with this message at 14:48 on Sep 6, 2018 |
# ? Sep 6, 2018 14:30 |
|
NihilCredo posted:for comparison, this is its cousin f# interactive: Also, I should probably use f# more. I wish there was an interpreter/repl for it for .net core. mystes fucked around with this message at 14:53 on Sep 6, 2018 |
# ? Sep 6, 2018 14:50 |
|
Oh another haskell thing: there's a new "Simple GHC (Haskell) Integration" plugin for vscode that has no dependencies (it just uses ghc). It's a little bit buggy but I can at least get it to work mostly which is more than I can say about the older pugins that use intero, etc. (What's funny is i looked on r/haskell to see what IDEs people are using now, and the most popular recommendation now seems to give up on the idea of getting syntax error highlighting and type information in the IDE and use ghcid in a separate window which I think is a good illustration of how loving horrible the haskell tooling situation is.) Also, it's funny that if you try to google how to add dependencies to a stack project, pretty much every site says to add it to the Cabal file, but apparently now you have to add it to the package.yaml file instead. mystes fucked around with this message at 15:01 on Sep 6, 2018 |
# ? Sep 6, 2018 14:58 |
|
are C++ abstract base classes just what would in other languages be called interfaces?
|
# ? Sep 6, 2018 16:16 |
|
You can still have implementation in abstract classes, but it's the closest you are going to get.
|
# ? Sep 6, 2018 16:20 |
|
Luigi Thirty posted:are C++ abstract base classes just what would in other languages be called interfaces? In the case where there are no fields and all methods are pure virtual, yeah, that's quite similar to Java's/C#'s/Go's/ God knows how many other languages' interface concept e: technically having _any_ pure virtual methods means the class is abstract, having _only_ pure virtual methods means the class is an interface (?)
|
# ? Sep 6, 2018 16:28 |
|
mystes posted:Oh another haskell thing: there's a new "Simple GHC (Haskell) Integration" plugin for vscode that has no dependencies (it just uses ghc). It's a little bit buggy but I can at least get it to work mostly which is more than I can say about the older pugins that use intero, etc. i deactivated every haskell plugin i had and activated that one. it does absolutely nothing for me, it doesn't even seem to recognize .hs files (they say 'Plain text' in the bottom right and when i searched the marketplace for extensions supporting it, simple ghc did not show up). adding the ghci folder to PATH didn't seem to help either
|
# ? Sep 6, 2018 16:34 |
|
NihilCredo posted:i deactivated every haskell plugin i had and activated that one. it does absolutely nothing for me, it doesn't even seem to recognize .hs files (they say 'Plain text' in the bottom right and when i searched the marketplace for extensions supporting it, simple ghc did not show up). adding the ghci folder to PATH didn't seem to help either By default it autodetects whether you're using stack based on the presence of package.yaml and you shouldn't need the ghc executable to be located in a folder in your path in that case (it will run it via stack). However, it doesn't seem to show any errors if it has trouble running ghc for some reason. It seems to be alpha quality but I still prefer it to the alternatives. mystes fucked around with this message at 16:46 on Sep 6, 2018 |
# ? Sep 6, 2018 16:44 |
|
mystes posted:I think you also need to have the haskell syntax highlighting plugin installed even though it isn't included as a dependency. installed that plugin, the syntax highlighting works but no type integration yet i'm in the folder of a stack project that builds (stack new HelloWorld yesod-sqlite). fake edit: ok, i found a 'GHC' entry under terminals where the following lines appear when I open a new .hs file: quote:-> :set prompt "" i'm guessing the hspec dependency is being a problem? any idea how i can fix that?
|
# ? Sep 6, 2018 17:02 |
|
NihilCredo posted:installed that plugin, the syntax highlighting works but no type integration yet code:
|
# ? Sep 6, 2018 17:33 |
|
mystes posted:I don't understand the haskell tooling well enough to say why this is happening, but it looks like you can fix this by forcing stack to get some additional dependencies: thank you! did you find the solution on google? after i fixed the hspec dep, it did indeed require yesod-test as well, but i hadn't posted that no type lens yet but at least errors and completions work
|
# ? Sep 6, 2018 18:03 |
|
NihilCredo posted:thank you! did you find the solution on google? after i fixed the hspec dep, it did indeed require yesod-test as well, but i hadn't posted that quote:no type lens yet but at least errors and completions work
|
# ? Sep 6, 2018 19:01 |
|
eschaton posted:the Haskell community should rewrite git in Haskell i wish apple would start an open source alternative. git can be really frustrating to use
|
# ? Sep 6, 2018 19:19 |
|
suffix posted:decent answers imo much appreciated, i'd never heard about minimum query tables until now however, i have a dumb baby question: how do you impose both oldest-to-newest and lowest-to-highest invariants simultaneously?
|
# ? Sep 6, 2018 20:19 |
|
cjs: trying to run Go tests and bypass the cached test results, i.e. force the tests to run even if no code change was detected. I looked through the docs and nothing is listed as a way to disable the test caching. Oh but I found a github issue where someone asked this and after being told that github isn't an appropriate place to learn go, was directed to the release notes for Go 1.10. quote:Test caching applies only to successful test results; only to go test commands with an explicit list of packages; and only to command lines using a subset of the -cpu, -list, -parallel, -run, -short, and -v test flags. The idiomatic way to bypass test caching is to use -count=1. How the flying gently caress is -count=1 ~~idiomatic~~? That's about as idiomatic as those knucklehead git commands posted a few pages back. There's a light at the end of this tunnel though... as we might be ending this horrible Go excursion and go back to the original .net core platform we were originally going to use. I won't go into exhaustive detail, but the Russian contractors managed to pull their heads out of their asses and fix some of their broken-rear end .net poo poo so we might have a usable codebase from them. I am so seriously sick of Go's "idiomatic" bullshit right now.
|
# ? Sep 6, 2018 21:05 |
|
prisoner of waffles posted:In the case where there are no fields and all methods are pure virtual, yeah, that's quite similar to Java's/C#'s/Go's/ God knows how many other languages' interface concept sort of. you can still write an implementation for a pure virtual function and the compiler will not complain (nor will the linker)
|
# ? Sep 6, 2018 21:36 |
|
Finster Dexter posted:cjs: trying to run Go tests and bypass the cached test results, i.e. force the tests to run even if no code change was detected. they misspelled idiotic.
|
# ? Sep 6, 2018 21:37 |
|
Finster Dexter posted:cjs: trying to run Go tests and bypass the cached test results, i.e. force the tests to run even if no code change was detected. quote:id·i·om
|
# ? Sep 6, 2018 21:49 |
|
Toady posted:i wish apple would start an open source alternative. git can be really frustrating to use it’s not Apple, but Eric Sink of SourceGear created an alternative called Veracity back in the day that was pretty good it did a few things extremely right:
unfortunately it also did a few things wrong that suppressed adoption and ultimately led to its failure in the market:
there’s an informative comparison of Veracity with other distributed version control systems on its site
|
# ? Sep 6, 2018 23:02 |
|
I have no idea what the use case is for blowing away history in a version control system. like the entire point of the thing is to preserve history.
|
# ? Sep 6, 2018 23:04 |
|
incremental commits like "wip" or "linting" or "wtf" that will always stay local should probably be rewritten to represent the final units of work before pushed to the remote
|
# ? Sep 6, 2018 23:10 |
|
|
# ? Dec 3, 2024 15:45 |
|
why even bother to commit them locally? if they're worth committing they're worth keeping.
|
# ? Sep 6, 2018 23:11 |