Skip to content

Instantly share code, notes, and snippets.

View Oregu's full-sized avatar

Oleg Prophet Oregu

View GitHub Profile
@quchen
quchen / trolling_haskell
Last active November 12, 2024 00:10
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell
(declare numbero*)
(defn symbolo* [x]
(reify
IConstraintStep
(-step [this s]
(reify
clojure.lang.IFn
(invoke [_ s]
(let [x (walk s x)]
(ns turel.core
(:refer-clojure :exclude [==])
(:use clojure.core.logic))
(defn not-membero
[x l]
(conde [(emptyo l)]
[(fresh [head tail]
(conso head tail l)
(!= head x)
@eugene-sy
eugene-sy / snakeToCammel.coffee
Created May 26, 2014 08:13
Convert string with snake_case to UpperCamelCase and lowerCamelCase
snakeToCamel: (s) ->
s.replace(/(_\w)/g, (m) -> return m[1].toUpperCase() )
snakeToUpperCamel: (s) ->
s.charAt(0).toUpperCase() + s.slice(1).replace(/(_\w)/g, (m) -> return m[1].toUpperCase() )
@Oregu
Oregu / _.java
Last active August 29, 2015 14:02
Underscore java
/////////////////////////////////////////////////////
//
// Moved to repository:
// https://github.com/Oregu/_.java
//
/////////////////////////////////////////////////////
import java.util.function.BiFunction;
import java.util.function.Function;
@andrejbauer
andrejbauer / topology.v
Last active November 28, 2023 19:40
How to get started with point-set topology in Coq. This is not actually how one would do it, but it is an intuitive setup for a classical mathematician.
(* How do to topology in Coq if you are secretly an HOL fan.
We will not use type classes or canonical structures because they
count as "advanced" technology. But we will use notations.
*)
(* We think of subsets as propositional functions.
Thus, if [A] is a type [x : A] and [U] is a subset of [A],
[U x] means "[x] is an element of [U]".
*)
Definition P (A : Type) := A -> Prop.
@sdiehl
sdiehl / preamble.hs
Last active February 1, 2016 20:16
Modern Haskell Preamble
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
@gelisam
gelisam / UnderstandingPipes.md
Last active May 16, 2019 13:48
Understanding the Pipes library

In response to this reddit post about failing to understand the Pipes library after a couple of hours. I wanted to show how an experienced haskeller does it, but I'm afraid it also took me quite a few hours, which is why the following list of steps goes on and on.

After all those hours, my opinion is that Pipes is not at all an easy library. I don't know if Conduit is any easier, but otherwise I side with your friend in advising to use something else (perhaps ordinary lazy IO?) instead of Pipes.

Anyway, here is the full brain dump of my steps as I tried to get your three snippets to fit together.

  • Since you say that you have a hard time combining the snippets, I assume that they must have complicated types. So my first goal is to figure out the type of your first snippet.
  • hoogle for parseUrl, withManager, etc. No results.
  • Google for haskell runEffect, find that it's a method from Pipes.Core,
@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing