This file contains hidden or 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 Maybe<'a> = | |
| | Some of 'a | |
| | None | |
| let fmap f m = | |
| match m with | |
| | Some(a) -> Some(f a) | |
| | None -> None | |
| type Free<'a> = |
This file contains hidden or 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 Toy<'r, 'next> = | |
| | Output of 'r * 'next | |
| | Bell of 'next | |
| | Done | |
| let fmap f a = | |
| match a with | |
| | Output (x,next) -> Output (a,f next) | |
| | Bell(next) -> Bell(f next) | |
| | Done -> Done |
This file contains hidden or 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
| module CArray = | |
| type CArray<'a> = CA of 'a array * int | |
| let fmap f (CA(a, i)) = CA(Array.map f a, i) | |
| let extract (CA(a, i)) = a.[i] | |
| let extend f (CA(a, i)) = | |
| let es' = Array.mapi (fun i _ -> f (CA(a,i))) a | |
| in CA(es',i) | |
| module MArray = | |
| type CA<'a> = CA of 'a array * int |
This file contains hidden or 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 Helpers = | |
| let memoize f = | |
| let dict = new System.Collections.Generic.Dictionary<_,_>() | |
| fun n -> | |
| match dict.TryGetValue(n) with | |
| | (true, v) -> v | |
| | _ -> | |
| let temp = f(n) | |
| dict.Add(n, temp) |
This file contains hidden or 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
| //extend :: (w a -> b) -> w a -> w b | |
| //duplicate :: w a -> w (w a) | |
| //extract :: w a -> a | |
| module CoReader = | |
| type CoReader<'e, 'a> = CoReader of env : 'e * value : 'a | |
| let askC (CoReader(env, _)) = env | |
| let extract (CoReader(_, value)) = value | |
| let extend f w = CoReader(askC w, f w) | |
| let duplicate w = extend id w |
This file contains hidden or 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 Request<'i,'o,'k> = 'i * ('o -> 'k) | |
| let bindRequest bind f (s,k) = s, fun v -> bind(k v,f) | |
| type Toy<'r> = | |
| | Output of Request<string,unit,Toy<'r>> | |
| | Input of Request<unit, string,Toy<'r>> | |
| | Pure of 'r | |
| type ToyBuilder() = | |
| member x.Bind(v:Toy<'a>,f:'a->Toy<'b>) = |
This file contains hidden or 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
| // Learn more about F# at http://fsharp.net | |
| // See the 'F# Tutorial' project for more help. | |
| type Prj<'a> = Async<Option<'a>> | |
| type ProjectBuilder() = | |
| member this.Bind(x, f) = | |
| async{ | |
| let! x = x | |
| match x with |
This file contains hidden or 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
| from sklearn.feature_selection.base import SelectorMixin | |
| #sklearn fix | |
| def get_support(self, indices=False): | |
| if hasattr(self, 'mask_cache'): | |
| return self.mask_cache | |
| mask = self._get_support_mask() | |
| self.mask_cache = mask if not indices else np.where(mask)[0] | |
| return self.mask_cache | |
| SelectorMixin.get_support = get_support |
This file contains hidden or 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
| // Step 0. Boilerplate to get the paket.exe tool | |
| open System | |
| open System.IO | |
| open System.Net | |
| open System.Net.Sockets | |
| open System.Threading | |
| //open Hopac | |
| module ServerM = |
This file contains hidden or 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
| session [default=1] pam_permit.so | |
| session requisite pam_deny.so | |
| session required pam_permit.so | |
| session optional pam_umask.so | |
| session required pam_unix.so | |
| session optional pam_systemd.so | |
| session required pam_limits.so |