Skip to content

Instantly share code, notes, and snippets.

🎯
Attempting to focus

rightfold rightfold

🎯
Attempting to focus
Block or report user

Report or block rightfold

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ConflictingEffect.md

If you are getting "Conflicting definitions are in scope for kind Effect", this is because you are using compiler 0.10 with purescript-eff 3.0.0. purescript-eff 3.0.0 is for compiler 0.11.

You should downgrade purescript-eff to 2.0.0 for the time being. Likewise, downgrade purescript-prelude to 2.5.0 and purescript-psci-support to 2.0.0. You can do this by changing the version numbers in bower.json and invoking bower install.

View gist:dee196fb5008f8acd5fcb56445bad48a

OpenCart Issue #1286

This is the full version of the thread for opencart#1286, archived from notification emails.
The discussion has since been deleted almost entirely by OpenCart's developer.
Everyone who posted in it has also been blocked from the OpenCart repo.


Damian Bushong

View LeibnizForGADT.hs
{-# LANGUAGE GADTs, TypeOperators, ScopedTypeVariables #-}
import Data.Eq.Type
import Unsafe.Coerce
data Expr e a where
Sum :: Expr [x] Int -> Expr [x] Int
-- | This is almost ADT, x is existetial.
data Expr' e a where
@rightfold
rightfold / CONTRIBUTING.md
Last active May 13, 2016
rightfold's constructive contribution guidelines template (work in progress)
View CONTRIBUTING.md

Contribution guidelines

What is a contribution?

A contribution is any of the following:

  • pull request,
  • bug report,
  • feature request,
  • discussion, or
@rightfold
rightfold / unique_lock_prioritizing_shared_mutex.hpp
Last active Nov 27, 2015
Just like a shared mutex, except acquiring a shared lock while a thread is waiting to acquire a unique lock will block.
View unique_lock_prioritizing_shared_mutex.hpp
template<typename SharedMutex>
class unique_lock_prioritizing_shared_mutex {
public:
void lock() {
std::lock_guard<decltype(control)> lock(control);
mutex.lock();
}
void unlock() {
mutex.unlock();
View ObservableAdresses.cs
using System;
using System.Reactive.Disposables;
using System.Reactive.Linq;
internal sealed class ObservableAdresses : IDisposable
{
private readonly IDisposable _connection;
private bool _disposed;
public ObservableAdresses(IPoller poller)
View NotifyCollectionChangedEventArgs.cs
public class NotifyCollectionChangedEventArgs<T>
{
private readonly NotifyCollectionChangedEventArgs _args;
public NotifyCollectionChangedEventArgs(NotifyCollectionChangedEventArgs args)
{
_args = args;
}
public IEnumerable<T> NewItems => _args.NewItems?.Cast<T>() ?? Enumerable.Empty<T>();
@rightfold
rightfold / passgen.hs
Last active Aug 29, 2015 — forked from ThomasLocke/passgen.hs
A Haskell noob trying to create sorta-kinda random passwords
View passgen.hs
import Control.Applicative
import System.Environment
import System.Exit
import System.Random
main = getArgs >>= parseArgs
-- Exit with success.
exit :: IO a
exit = exitWith ExitSuccess
View transaction.hs
do
balanceA <- newTVarIO (400 :: Int)
balanceB <- newTVarIO (900 :: Int)
replicateM_ 100 . forkIO $ do
atomically $ do
modifyTVar balanceA (\x -> x + 2)
modifyTVar balanceB (\x -> x - 2)
readTVarIO balanceA >>= print
readTVarIO balanceB >>= print
You can’t perform that action at this time.