---
title: "Comment by Grzegorz Rozdzialik on \"Practical Guide to Fp-ts P2: Option, Map, Flatten, Chain\" | Hashnode"
description: "Nice guide! Just wanted to say that the final example can be simplified a bit. O.map and O.fromNullable can be replaced with a single function: O.fromNullable ."
url: "https://hashnode.com/posts/practical-guide-to-fp-ts-part-2/6071ba4b8b2b857c0bdb5e52/comment/61e8165e6f4d6f431978da6c"
---

[Discussion](https://hashnode.com/posts/practical-guide-to-fp-ts-part-2/6071ba4b8b2b857c0bdb5e52)

Comment [Practical Guide to Fp-ts P2: Option, Map, Flatten, Chain](https://hashnode.com/posts/practical-guide-to-fp-ts-part-2/6071ba4b8b2b857c0bdb5e52)

[Grzegorz Rozdzialik](https://hashnode.com/@Gelio)

[Jan 19, 2022](https://hashnode.com/posts/practical-guide-to-fp-ts-part-2/6071ba4b8b2b857c0bdb5e52/comment/61e8165e6f4d6f431978da6c)

Nice guide!

Just wanted to say that the final example can be simplified a bit. `O.map` and `O.fromNullable` can be replaced with a single function: `O.fromNullable`.

```
pipe(
  foo,
  O.fromNullable,
  O.chain(O.fromNullableK(({bar}) => bar)),
  O.chain(O.fromNullableK(({buzz}) => buzz))
)
```

[TS playground](https://www.typescriptlang.org/play?ssl=24&ssc=1&pln=29&pc=2#code/JYWwDg9gTgLgBAbzmYYCmAaOAzANhAdzgF8coIQ4BybMAWhgGcB6XYAI2ewFcA7AYxjAIvKgFgAUKEiw4AKjgBDRnADyZCtVoMWbTqrBCRVANyTJ-EY3jYIEOAF5EkuHHaKoALmcTXr9twAXoHeAIwYLiSSxOYSKOgAFJG2EBG+agB02OQgAHLcuLiK7LiYkaoZIIpgCQlI7lAkAJSOAHxuHk1prhX8ABaKwLxJ6a54hCN+fhXZFPmFxaXdU5lVNXVuQYHNbZvBXZGuB+nHTbHMzHBoAI7cwABuiqW88DAQsfFokzh2yzM58yKJTK6V6AyGCX+cwKQNKAGlaggGsQWg52g0mscehl+oNhlC8jDFmgEXUAsEUbtyYFMZImkA)

[Andreas Herd](https://hashnode.com/@Mendrik)

[Mar 20, 2023](https://hashnode.com/posts/practical-guide-to-fp-ts-part-2/6071ba4b8b2b857c0bdb5e52/comment/61e8165e6f4d6f431978da6c#reply-6418ae476fd77cec7793b485)

What's the K in fromNullableK? I also saw optionT.

[Grzegorz Rozdzialik](https://hashnode.com/@Gelio)

[Mar 26, 2023](https://hashnode.com/posts/practical-guide-to-fp-ts-part-2/6071ba4b8b2b857c0bdb5e52/comment/61e8165e6f4d6f431978da6c#reply-64204831df7f026515a61dfc)

[Andreas Herd](https://hashnode.com/@Mendrik) Both suffixes are explained in [the FAQ in the fp-ts documentation](https://gcanti.github.io/fp-ts/guides/code-conventions.html#faq). `K` is for Kleisli arrow, `T` is for transformer.
