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
{-# LANGUAGE InstanceSigs #-} | |
-- import Geometry | |
import qualified Data.Map as Map | |
import Data.Char | |
import Data.List | |
import Data.Monoid | |
import qualified Data.Foldable as F | |
import Control.Applicative | |
import Control.Monad |
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
import S from 'sanctuary' | |
import _ from 'lodash' | |
/* | |
mix 將所有 prototype 的 property 全部複製成新的 prototype ,而 prototype 的 prototype 一層一層合成複製起來,才能維持原本的階層架構 | |
mix 的 function 不能有任何帶有任何參數,因為想要從mix的先後順序呼叫 Constructors | |
Symbol.(mixPrototypes) 紀錄所以有 Constructors | |
根據 特性 實作各自繼承組合起來 | |
例如: MonoidArray 跟 MonadArray 各自的 定義 mix 起來 變成實際使用的 Array |
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
{ | |
"error": 0, | |
"status": "Success", | |
"date": "2014-02-13", | |
"result": { | |
"name": "颐和园", | |
"location": { | |
"lng": 116.27068715319, | |
"lat": 39.993241267979 | |
}, |
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
{- | |
多行註解 | |
-} | |
-- 單行註解 | |
{- | |
We'll say that a stateful computation is a function that takes some state and returns a value along with some new state. | |
s -> (a,s) |
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
{- | |
learnyouahaskell.com/for-a-few-monads-more#writer | |
-} | |
newtype Writer2 w a = Writer2 { runWriter2 :: (a, w) } deriving (Eq, Show) | |
instance Functor (Writer2 w) where | |
fmap f m = let | |
(a, w) = (runWriter2 m) | |
in Writer2 (f a, 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
package com.lin1987www.app; | |
import android.os.Bundle; | |
import android.os.Parcel; | |
import android.util.Log; | |
import java.lang.reflect.Field; | |
import java.util.Map; | |
import de.greenrobot.event.EventBus; |
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
package com.github.kevinsawicki.http; | |
import com.squareup.okhttp.OkHttpClient; | |
import com.squareup.okhttp.OkUrlFactory; | |
import java.io.IOException; | |
import java.net.HttpURLConnection; | |
import java.net.Proxy; | |
import java.net.URL; |