I'm taking down this post. I just posted this as a side comment to explain a sentence on my latest blog post. This wasn't meant to be #1 on HN to start a huge war on functional programming... The thoughts are not well formed enough to have a huge audience. Sorry for all the people reading this. And please, don't dig through the history...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open System.ServiceModel | |
open System.ServiceModel.Description | |
[<ServiceContract(ConfigurationName = "PublishService", Namespace = "http://xyz.gov/PublishService")>] | |
[<ServiceBehavior(InstanceContextMode=InstanceContextMode.PerSession)>] | |
type IPublishService = | |
[<OperationContract(Name="TestMethod")>] | |
abstract member TestMethod : name:string -> string | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(readr) | |
library(dplyr) | |
url <- "https://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-white.csv" | |
df <- | |
read_delim(url, delim = ";") %>% | |
dplyr::mutate(taste = as.factor(ifelse(quality < 6, "bad", ifelse(quality > 6, "good", "average")))) %>% | |
dplyr::select(-quality) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type List<'i,'r> = Nil | Cons of 'i*'r | |
type FixList<'i> = FixList of List<'i,FixList<'i>> | |
let rec fmap (f : 'a -> 'b) (l : List<'i,'a>) : List<'i,'b> = | |
match l with | |
| Nil -> Nil | |
| Cons (x, tail) -> Cons (x, f tail) | |
// you can express hylo directly without using ana and cata (by either following the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type DifferenceType<'TKey, 'T> = | |
| Added of 'TKey * 'T | |
| Removed of 'TKey * 'T | |
| Modified of 'TKey * 'T * 'T * seq<string * (string * string)> with | |
member this.Key = | |
match this with | |
| Added (key, _) | |
| Removed (key, _) | |
| Modified (key, _, _, _) -> key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[<AutoOpen>] | |
module IO = | |
type IO<'a> = | |
private | |
| Return of (unit -> 'a) | |
| Suspend of (unit -> IO<'a>) | |
let rec run x = | |
match x with | |
| Return v -> v() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convertToPlain(html){ | |
// Create a new div element | |
var tempDivElement = document.createElement("div"); | |
// Set the HTML content with the given value | |
tempDivElement.innerHTML = html; | |
// Retrieve the text property of the element | |
return tempDivElement.textContent || tempDivElement.innerText || ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#load @".paket\load\net452\FSharpPlus.fsx" | |
open FSharpPlus | |
open System | |
[<AutoOpen>] | |
module rec IO = | |
let run (IO computation) = computation() | |
type IO<'T> = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Helper to encode and set HTML fragment to clipboard.<br/> | |
/// See http://theartofdev.com/2014/06/12/setting-htmltext-to-clipboard-revisited/.<br/> | |
/// <seealso cref="CreateDataObject"/>. | |
/// </summary> | |
/// <remarks> | |
/// The MIT License (MIT) Copyright (c) 2014 Arthur Teplitzki. | |
/// </remarks> | |
public static class ClipboardHelper | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.github.nomisrev | |
import app.cash.sqldelight.driver.jdbc.asJdbcDriver | |
import arrow.continuations.SuspendApp | |
import arrow.continuations.ktor.server | |
import arrow.fx.coroutines.autoCloseable | |
import arrow.fx.coroutines.closeable | |
import arrow.fx.coroutines.resourceScope | |
import com.zaxxer.hikari.HikariConfig | |
import com.zaxxer.hikari.HikariDataSource |
OlderNewer