type alias Model = {
userId : String
}
model = { userId = "726f27bf-6b3d-4421-8c26-9b77c6a57360" }
displayUserId : String -> String
displayUserId userid =
"User Id is: " ++ userid
type alias UserId = String
Type alias Model = {
userId : UserId
}
displayUserId : UserId -> String
displayUserId userid =
"User Id is: " ++ userid
type UserId = UserId String
type alias Model = {
userId : UserId
}
model = { userId = UserId "726f27bf-6b3d-4421-8c26-9b77c6a57360" }
displayUserId : UserId -> String
displayUserId userId =
case userId of
UserId idString ->
"User Id is: " ++ idString
type alias UserId = String
type alias UserEmail = String
type User = LoggedInUser UserId UserEmail
| AnonymousUser
--- we know our user
user = User "726f27bf-6b3d-4421-8c26-9b77c6a57360" "user@example.com"
--- just someone who walked in off the street
user = AnonymousUser
displayUserId : User -> String
displayUserId user =
case user of
User idString _ ->
"User Id is: " ++ idString
AnonymousUser ->
"User is not logged in"
module User exposing (User, createUser, anonymousUser, displayUserId, getUserEmail)
type alias UserId = String
type alias UserEmail = String
type User = LoggedInUser UserId UserEmail
| AnonymousUser
createUser : UserId -> UserEmail -> Maybe User
createUser id email =
if (isValidId id) and (isValidEmail email) then
Just (User id email)
else
Nothing
anonymousUser : User
anonymousUser = AnonymousUser
getUserEmail : User -> String
getUserEmail user =
case user of
LoggedInUser _ email ->
email
AnonymousUser ->
"anon@nowhere.com"
--- isValidId, isValidEmail, displayUserId left to the imagination
My new year’s resolution last year was to meditate every day this year, which in thirty-two years is the first resolution I can remember completing, and it feels pretty good. Meditation isn’t something that I mention much because I worry people will find it obnoxious. However, I do think it’s something that can help almost everyone, so now, under the cover of humble bragging, I’m going to talk a little about it.
I first began meditation around three years ago, during an acute bout of anxiety, when a therapist suggested it to me. I’ve fought the depression/anxiety demon for as long as I can remember, doing years of talk therapy and taking piles of medication. While those both worked in varying degrees, for me, mindfulness has been the closest thing to a silver bullet I’ve tried. (That's not to say those aren't valid treatment options, in high school they likely saved my life.) With regular meditation, I’ve found myself in much better control of my anxiety, and as a result, happier.
This also isn’t to say that you need to complete a year of daily meditation for positive effects. Before this year, I skipped days frequently, and during the year, not every day was what you would call “zen”. Most days I sat for five to ten minutes, but I also meditated for ten seconds with my eyes closed on the top of a mountain with someone talking to me, drunk and sitting on the floor next to my bed after waking in a panic realizing I’d forgotten, and while pushing a sleeping toddler in a stroller through disney world. All good, and the overall change in my life has always been positive.
Anyway, I’m carrying on a bit more than what my point needs. If you’re looking for a way to improve your life this year (it is the new year season after all), please consider trying a meditation practice. When I first started I found Headspace’s Take Ten program a good starting point, although I now use a different app (Insight Timer) to track my progress. I’d also recommend reading Mindfulness in Plain English (also free online here). I’ve read it a few times now, and every time I get more out of it. Also feel free to send me an email or tweet, it’s something I’m happy to talk to interested people about.
As a related aside, this year has inspired me to plan and work on software to promote more mindful use of technology, so keep an eye here in the coming months.
Anyone who ever schedules meetings with developers, please burn this image into your brain, thanks pic.twitter.com/IEoy10cgxW
— Phil 🍕 (@phil_wade) August 11, 2017
I'm not going to talk much about the concept of developers and context switching, since it's hardly a concept I came up with by myself and it's one that's been covered pretty well by people much more eloquent than me. However, I did see some common themes in response to my tweet and I figured here would be a better place to address them than in batches of 140 characters. Here goes:
There were a few negative responses floating around, but I don't feel they really need to be addressed, since they were from people taking things just a little too seriously. It's just a silly tweet, they're just dumb meetings, let's all try to be our happiest, ay?
Thanks for reading, hope you have a good day.