Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Activity for toraritteā€­

Type On... Excerpt Status Date
Comment Post #291228 Wow, the simplicity of this blew my mind. Did you come up with this on the spot or is this a well known formula in other (pure) functional programming languages? I'm also trying to make sense how `id` can be the first argument to `>=>`, so here's another question if you are interested: [Why does `le...
(more)
12 months ago
Edit Post #291229 Initial revision 12 months ago
Question Why does `let map f = id >=> switch f` work in F#?
Asked How to implement `map` using the fish (>=>, Kleisli composition) operator in F#? a couple of hours ago, and r's answer blew my mind: ``` let map f = id >=> switch f ``` It is perfect in its simplicity, but when I look at the type signatures, it is not supposed to work. I've been at it f...
(more)
12 months ago
Edit Post #291227 Initial revision 12 months ago
Question How to implement `map` using the fish (>=>, Kleisli composition) operator in F#?
I'm learning monadic composition through Scott Wlaschin's Railway-oriented Programming post. Once`bind`, `switch`, and `>=>` functions are defined, he introduces `map` to show how to "turn a one-track function into a two-track function". That is: ``` f: a -> b => f': T -> T ``` The imp...
(more)
12 months ago
Edit Post #291216 Post edited:
12 months ago
Edit Post #291216 Post edited:
about 1 year ago
Edit Post #291216 Post edited:
about 1 year ago
Suggested Edit Post #291217 Suggested edit:

(more)
declined about 1 year ago
Comment Post #291217 Oh wow, I feel like an idiot - thank you for pointing out the error in my reasoning!
(more)
about 1 year ago
Edit Post #291216 Initial revision about 1 year ago
Question Why does RFC 3986 (URI generic syntax) declare the "host" component to be case-insensitive when the syntax rules show it to be case-sensitive?
First, a reminder to future self (the figure RFC 3986, Section 3. Syntax Components complemented with Section 3.2. Authority): ``` The following are two example URIs and their component parts: userinfo host port | | | ...
(more)
about 1 year ago
Edit Post #291180 Initial revision about 1 year ago
Answer A: How to start creating a Giraffe web project and how to serve it?
I have to keep reminding myself that > a Giraffe project plugs into the ASP.NET Core pipeline or is itself an ASP.NET Core application , so if I can't find answers to my questions in the Giraffe docs, then it is probably because it is an ASP.NET Core topic (or an F# / .NET / etc. one). How ...
(more)
about 1 year ago
Edit Post #291179 Initial revision about 1 year ago
Question How to start creating a Giraffe web project and how to serve it?
Having some trouble with `giraffe-template` on Mac M1, so decided to set up a Giraffe project manually. Started following the Doing it manually section of the Giraffe README, but got stuck right away, and I also couldn't see mentioned anywhere how the project could be served. > For the record, the...
(more)
about 1 year ago
Comment Post #291125 Thank you again! I just moved my comments into an answer, and also quoted an answer from Stackoverflow that confirms my assumptions. Have a great day!
(more)
about 1 year ago
Edit Post #291165 Post edited:
about 1 year ago
Edit Post #291125 Post edited:
about 1 year ago
Edit Post #291165 Post edited:
about 1 year ago
Edit Post #291165 Initial revision about 1 year ago
Answer A: .NET dependency management: `dotnet add package` vs. Paket?
Based on what I know so far, there is no difference. Paket has been created more than 10 years ago to address (perceived?) shortcomings of NuGet. (Reading the .NET history made my head spin, and looks like things started to speed up significantly after the 2020s.) Paket has features that may be...
(more)
about 1 year ago
Edit Post #291125 Post edited:
about 1 year ago
Comment Post #291125 Thank you for the encouragement! I thought about that, because those points do sound plausible, but I have just started out with .NET in earnest, so it is just guesswork. I also didn't want to discourage answers. If no-one refutes those points in a day or two, I'll definitely post them as answers...
(more)
about 1 year ago
Edit Post #291125 Post edited:
about 1 year ago
Edit Post #291125 Initial revision about 1 year ago
Question .NET dependency management: `dotnet add package` vs. Paket?
Many older projects (i.e., older than 5 years) provide instructions to the Paket .NET dependency manager (e.g., Suave), so I started digging into it, got confused, then gave up for while because errors kept cropping up and I just wanted to make progress. I reached a point in my project where I hav...
(more)
about 1 year ago
Edit Post #290660 Initial revision about 1 year ago
Question How to write a function that only accepts a list of `Error string` `Results` in F# on the level of types?
For example, given a `mergeErrors` function where input is always a list of `Error string`s, ```fsharp let es = [ Error 1; Error 2; Error 3 ] let mergeErrors (errors: Result list) : Result = errors |> List.map (function | Error e -> e) |> Error mergeErrors (es: Result list)...
(more)
about 1 year ago
Edit Post #290497 Post edited:
about 1 year ago
Edit Post #290574 Post edited:
about 1 year ago
Edit Post #290574 Post edited:
about 1 year ago
Edit Post #290574 Initial revision about 1 year ago
Question What is a "sealed" type in F# and why doesn't the type test pattern operator (:?) work on it out of the `box`?
The F# language guide (see Signatures article) has a very sparse definition of what a "sealed" type is: > |Attribute|Description| > |--- |--- | > |`[]`|For a type that has no abstract members, or that should not be extended.| > |`[]`|For a type that is an interface.| I searched the entire PD...
(more)
about 1 year ago
Edit Post #290558 Post edited:
about 1 year ago
Edit Post #290557 Post edited:
about 1 year ago
Edit Post #290556 Post edited:
about 1 year ago
Edit Post #290558 Initial revision about 1 year ago
Answer A: How to change the color of a cell to a user defined value while keeping its existing style using NPOI from F#?
Solved this by writing my own clone function: ```fsharp open System.Reflection let cloneCellStyle (cell: NPOI.XSSF.UserModel.XSSFCell) = let original = cell.CellStyle // printfn "ORIGINAL: %A" original.FontIndex let workbook = cell.Sheet.Workbook let copy = workbook.Create...
(more)
about 1 year ago
Edit Post #290557 Initial revision about 1 year ago
Question How to change the color of a cell to a user defined value while keeping its existing style using NPOI from F#?
The answer provided in the How to set the cell color to a user defined value using NPOI from F#? thread solves the problem of how to set the right properties using F#, but it uses a new `ICellStyle` object and overwrites the existing style with it. Re-writing the function (see below) to setting th...
(more)
about 1 year ago
Edit Post #290556 Initial revision about 1 year ago
Answer A: How to set the cell color to a user defined value using NPOI from F#?
I failed to notice that a cell's `CellStyle` property returns the generic `ICellStyle`, which has to be cast down to `NPOI.XSSF.UserModel.XSSFCellStyle` in order to gain access to the `FillBackgroundXSSFColor` and `FillForegroundXSSFColor` properties. Also, here's a summary of which property does ...
(more)
about 1 year ago
Edit Post #290555 Initial revision about 1 year ago
Question How to set the cell color to a user defined value using NPOI from F#?
As far as I can tell (from F# at least), cell can only be colored using predefined `NPOI.SS.UserModel.IndexedColors`. From the available methods / properties, ``` val it: ICellStyle = NPOI.XSSF.UserModel.XSSFCellStyle { ... FillBackgroundColor = -494s; FillBackgroundColorColor...
(more)
about 1 year ago
Comment Post #290488 The SE thread [What is your way to create good passwords that can actually be remembered?](https://security.stackexchange.com/questions/662/what-is-your-way-to-create-good-passwords-that-can-actually-be-remembered) ([archived](https://web.archive.org/web/20230601214152/https://security.stackexchange....
(more)
about 1 year ago
Edit Post #290548 Initial revision about 1 year ago
Answer A: What is the difference between `static let` and `static member` in F#?
Paraphrasing the F# language guide's `let` Bindings in Classes article: > A `let` binding in a class creates a private field or function; > to expose data or functions publicly, declare a property or a member > method. > > + An instance `let` binding is a `let` binding that is not preceded by...
(more)
about 1 year ago
Edit Post #290547 Initial revision about 1 year ago
Question What is the difference between `static let` and `static member` in F#?
Taking the example from this Stackoverflow question: ``` type Vector2D(dx : float, dy : float) = static let zero = Vector2D(0.0, 0.0) static let onex = Vector2D(1.0, 0.0) static let oney = Vector2D(0.0, 1.0) /// Get the zero vector static member Zero = zero ///...
(more)
about 1 year ago