Skip to content

Instantly share code, notes, and snippets.

_"es generación Lazy"_
tienes razón y quizás la he obviado injustamente, es una buena herramienta, pero piensa
por ejemplo que en C#, tú puedes escribir igualmente lo siguiente:
{{
var ApiGit = new JsonProvider<Repo>("http...");
var repo = ApiGit.Load("https://api.github.com/repos/"+user+"/"+repoName);
var gIndex = 3 * repo.Forks + repo.StargazersCount + repo.WatchersCount;
}}
Entonces, VS te dará errores de tipo, pero *si tienes en background el "generador de wrappers"*
import Prelude hiding (map)
-- Generalizar el mapeo (por ejemplo) consiste en definirlo
class Mappeable f where
map :: (a -> b) -> f a -> f b
*** AVISO, si lees ésto podrías llegar a desaprender ***
Cuidado con las mónadas, yo estoy bastante seguro de no entenderlas (bien).
Me explico, el concepto "por definición" de mónada es bastante simple,
bastante confuso al principio (como todo, supongo) pero luego es simple
(simple en el sentido de que las reglas que se aplican son sencillas,
luego cada mónada ya... puede ser infumable de entender).
(Ojo, lo que sigue hasta el siguiente aviso es una explicación CONCEPTUAL,
// La currificación (estilo Haskell) se consigue
// de forma efectiva con sólo separar los
// argumentos 1º, 2º, ... con paréntesis en lugar
// de comas.
//
// Por ejemplo, en lugar de
//
// miFuncion(arg1, arg2, arg3)
//
// Hacer
@chintak
chintak / install_simplecv.sh
Last active June 1, 2018 15:56
Install SimpleCV/OpenCV in a Virtual Environment on Mac OSX
# First install homebrew
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
# Choose the name of the virtualenv as simplecv
virtualenv simplecv --no-site-packages
source simplecv/bin/activate
# This activates the virtualenv; your command prompt should change from `$` to `(simplecv)$`
# Next the dependencies
sudo easy_install pip # Can be ignored, if pip already present
@jhaberstro
jhaberstro / hkt.cpp
Last active September 25, 2020 12:28
Functor, Maybe, and Higher-Kinded Types in C++
// Example program
#include <iostream>
#include <string>
#include <vector>
#include <type_traits>
//---------------------
// Maybe and MyVector, two totally unrelated classes whose only commanilty is that they are both type constructors of the same arity (e.g. 1) and order (e.g. 1).
//---------------------
template< typename T >
@lborg019
lborg019 / codevr.Build.cs
Last active November 13, 2020 08:50
Boost library in Unreal
// Fill out your copyright notice in the Description page of Project Settings.
using System;
using System.IO;
using UnrealBuildTool;
public class codevr : ModuleRules
{
public codevr(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;