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 |
---|---|---|---|---|
Edit | Post #291229 | Initial revision | — | 9 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) |
— | 9 months ago |
Edit | Post #291227 | Initial revision | — | 9 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) |
— | 9 months ago |
Edit | Post #291216 |
Post edited: |
— | 9 months ago |
Edit | Post #291216 |
Post edited: |
— | 9 months ago |
Edit | Post #291216 |
Post edited: |
— | 9 months ago |
Suggested Edit | Post #291217 |
Suggested edit: (more) |
declined | 9 months ago |
Comment | Post #291217 |
Oh wow, I feel like an idiot - thank you for pointing out the error in my reasoning! (more) |
— | 9 months ago |
Edit | Post #291216 | Initial revision | — | 9 months 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) |
— | 9 months ago |
Edit | Post #291180 | Initial revision | — | 9 months 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) |
— | 9 months ago |
Edit | Post #291179 | Initial revision | — | 9 months 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) |
— | 9 months 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) |
— | 9 months ago |
Edit | Post #291165 |
Post edited: |
— | 9 months ago |
Edit | Post #291125 |
Post edited: |
— | 9 months ago |
Edit | Post #291165 |
Post edited: |
— | 9 months ago |
Edit | Post #291165 | Initial revision | — | 9 months 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) |
— | 9 months ago |
Edit | Post #291125 |
Post edited: |
— | 9 months 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) |
— | 9 months ago |
Edit | Post #291125 |
Post edited: |
— | 9 months ago |
Edit | Post #291125 | Initial revision | — | 9 months 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) |
— | 9 months ago |
Edit | Post #290660 | Initial revision | — | 11 months 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) |
— | 11 months ago |
Edit | Post #290497 |
Post edited: |
— | 11 months ago |
Edit | Post #290574 |
Post edited: |
— | 11 months ago |
Edit | Post #290574 |
Post edited: |
— | 11 months ago |
Edit | Post #290574 | Initial revision | — | 11 months 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) |
— | 11 months ago |
Edit | Post #290558 |
Post edited: |
— | 11 months ago |
Edit | Post #290557 |
Post edited: |
— | 11 months ago |
Edit | Post #290556 |
Post edited: |
— | 11 months ago |
Edit | Post #290558 | Initial revision | — | 11 months 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) |
— | 11 months ago |
Edit | Post #290557 | Initial revision | — | 11 months 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) |
— | 11 months ago |
Edit | Post #290556 | Initial revision | — | 11 months 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) |
— | 11 months ago |
Edit | Post #290555 | Initial revision | — | 11 months 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) |
— | 11 months 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) |
— | 11 months ago |
Edit | Post #290548 | Initial revision | — | 11 months 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) |
— | 11 months ago |
Edit | Post #290547 | Initial revision | — | 11 months 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) |
— | 11 months ago |
Edit | Post #290096 |
Post edited: |
— | 11 months ago |
- ← Previous
- 1
- 2
- 3
- 4
- Next →