해결됨
순수 함수형 프론트엔드 언어 Elm 가이드
Elm의 functor?
안녕하세요.또 하나의 선생님 챗지피티와 함께 수강하고 있습니다.그리고 (기대하시는 바와 조금 다르게) 함수형에 대해 전혀 모르지만, 필요와 끌림에 의해 일단 Elm 배우기를 시작했어요.질문입니다."엘름 아키텍쳐 - The Elm Architecture" 강의 중 펑터(functor)라는 표현을 쓰셨는데(정확히 어딘지 다시 못 찾겠네요 ㅜㅜ)챗지피티는 Elm엔 functor 라는게 없다라더라고요. 그런가요?챗지피티에 하고 받은 질문과 답변을 첨부합니다:---> "String.any Char.isDigit password" in here, "Char.isDigit" is called as functor right?> In Elm, the term "functor" is not typically used in the same way as it is in other functional programming languages like Haskell. In Haskell, a functor is a type class that implements the fmap function (or <$>) for a data structure, allowing you to apply a function to the values inside it.However, in the Elm context, Char.isDigit is simply a function that takes a Char and returns a Bool indicating whether the character is a digit or not. When you use it with String.any like String.any Char.isDigit password, Char.isDigit is not referred to as a functor but rather as a predicate function. String.any takes this predicate function and applies it to each character in the string, checking if any of the characters satisfy the predicate.In functional programming terms, you might say that String.any is a higher-order function because it takes another function (Char.isDigit in this case) as an argument. The combination of String.any and Char.isDigit checks each character of the string to see if it meets the criteria specified by Char.isDigit, which is to be a digit.So, to clarify:Char.isDigit is a predicate function.String.any is a higher-order function that applies the predicate to each element in a string.