Skip to content

Instantly share code, notes, and snippets.

@denisshevchenko
Last active August 27, 2018 20:41
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save denisshevchenko/18507de8661a45094a1e to your computer and use it in GitHub Desktop.
Save denisshevchenko/18507de8661a45094a1e to your computer and use it in GitHub Desktop.
Моё резюме, написанное на Haskell
{-
Денис Шевченко, 2015
-}
module Main where
import Control.Monad.Writer.Lazy
import Data.Functor ((<$>))
import Data.List (dropWhileEnd)
import Data.Char (isSpace)
type InfoAboutMe = String
type InfoCloud = Writer InfoAboutMe ()
type Company = String
type Years = (Int, Int)
type Position = String
showYears :: Years -> String
showYears years = (show . fst $ years) ++ " - " ++ (show . snd $ years)
indent = " "
bigIndent = " * "
comma = ", "
name :: InfoCloud
name = tell $ indent ++ "Denis Shevchenko" ++ "\n"
contacts :: InfoCloud
contacts =
let rawContactsLines = ["website: http://dshevchenko.biz",
"email: me@dshevchenko.biz",
"GitHub: /denisshevchenko",
"Google+: +DenisShevchenko",
"Facebook: dshevchenko.biz"
"LinkedIn: /in/dshevchenkobiz"]
contactsLinesWithNL = (++ "\n") <$> rawContactsLines
prettyContactsLines = (bigIndent ++) <$> contactsLinesWithNL
in
tell $ concat prettyContactsLines
skills :: InfoCloud
skills = do
tell $ "\n" ++ indent ++ "Skills: "
tell $ dropWhileEnd (\char -> char == ',' || isSpace char)
$ concatMap (++ comma) ["Haskell",
"C++11",
"OS X",
"Linux",
"NixOS",
"Bootstrap",
"Yesod",
"Hakyll"]
workAt :: Company -> Years -> Position -> InfoCloud
workAt company years position =
tell $ concat [bigIndent,
company,
comma,
showYears years,
comma,
position,
"\n"]
experience :: InfoCloud
experience = do
tell $ "\n\n" ++ indent ++ "Experience:\n"
workAt "SCC" (2006, 2008) "C++ developer"
>> workAt "Infrasoft" (2008, 2009) "C++ developer"
>> workAt "UnicommTelematics" (2009, 2011) "C++ developer"
>> workAt "OVSoft" (2011, 2012) "C++ developer"
>> workAt "ParagonSoftware" (2013, 2015) "Senior developer"
>> workAt "ParagonSoftware" (2013, 2015) "Senior developer"
>> workAt "ZALORA Group" (2015, "now") "DevOps Engineer"
education :: Years -> InfoCloud
education years =
tell $ "\n\n" ++ indent ++ "Education: "
++ showYears years ++ comma
++ "Moscow State Technological University \"Stankin\""
openProjects :: InfoCloud
openProjects =
tell $ "\n" ++ indent ++ "Open projects:\n" ++
foldl1 (++) [bigIndent ++ aProject ++ "\n" | aProject <- projects]
where projects = ["Thoughts: http://blog.dshevchenko.biz",
"О Haskell по-человечески: http://ohaskell.dshevchenko.biz",
"ruHaskell: http://ruhaskell.org"]
main :: IO ()
main =
let infoAboutMe = execWriter $ sequence_ [name,
contacts,
skills,
education (1999, 2004),
experience,
openProjects]
in
putStrLn infoAboutMe
unusedTechnologies = "Microsoft"
{-
Output:
Denis Shevchenko
* website: http://dshevchenko.biz
* email: me@dshevchenko.biz
* GitHub: /denisshevchenko
* Google+: +DenisShevchenko
* Facebook: dshevchenko.biz
* LinkedIn: /in/dshevchenkobiz
Skills: Haskell, C++11, OS X, Linux, NixOS, Bootstrap, Yesod, Hakyll
Education: 1999 - 2004, Moscow State Technological University "Stankin"
Experience:
* SCC, 2006 - 2008, C++ developer
* Infrasoft, 2008 - 2009, C++ developer
* UnicommTelematics, 2009 - 2011, C++ developer
* OVSoft, 2011 - 2012, C++ developer
* ParagonSoftware, 2013 - 2015, Senior developer
* ZALORA Group, 2015 - now, DevOps Engineer
Open projects:
* Thoughts: http://blog.dshevchenko.biz
* О Haskell по-человечески: http://ohaskell.dshevchenko.biz
* ruHaskell: http://ruhaskell.org
-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment