Created
May 3, 2020 09:37
-
-
Save matonix/9d9814d091658466f67a1af2a36b16e2 to your computer and use it in GitHub Desktop.
VSCode User Snippet for Haskell (AtCoder)
This file contains 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
{ | |
// Imports | |
"Import ByteString Char8": { | |
"prefix": "imbs", | |
"body": [ | |
"import qualified Data.ByteString.Char8 as BS", | |
], | |
"description": "Import BS" | |
}, | |
"Import Vector Unboxed": { | |
"prefix": "imvu", | |
"body": [ | |
"import qualified Data.Vector.Unboxed as VU", | |
"import qualified Data.Vector.Unboxed.Mutable as VUM", | |
], | |
"description": "Import VU/VUM" | |
}, | |
"Import for Int Line": { | |
"prefix": "imil", | |
"body": [ | |
"import qualified Data.ByteString.Char8 as BS", | |
"import qualified Data.ByteString.Lazy.Char8 as BSL", | |
"import qualified Data.ByteString.Builder as BSB", | |
"import Data.Char ( isSpace )", | |
"import Data.List ( unfoldr )" | |
], | |
"description": "Import for Int Line" | |
}, | |
// Reads | |
"Read ByteString Char8": { | |
"prefix": "rbs", | |
"body": [ | |
"${s} <- BS.getLine" | |
], | |
"description": "Read ByteString" | |
}, | |
"Read Int Line": { | |
"prefix": "ril", | |
"body": [ | |
"${xs} <- unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine" | |
], | |
"description": "Read Int Line" | |
}, | |
"Read Int": { | |
"prefix": "ri", | |
"body": [ | |
"${x} <- readLn" | |
], | |
"description": "Read Int" | |
}, | |
// Pragmas | |
"Pragma": { | |
"prefix": "pragma", | |
"body": [ | |
"{-# ${x} #-}" | |
], | |
"description": "Pragma" | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment